RudderStack's Device Mode Transformations feature enables you to use the powerful user transformations with the device mode-only destinations, for example, Firebase, Hotjar, etc.
Using this feature, you can enrich the event data using your custom logic. Moreover, it provides an easier way to filter out the events to get rid of the bad data, sample events to reduce costs to some destinations, and many more interesting use cases. To learn more about the use cases, refer to the Use case section.
RudderStack provides the Client Transformation service to facilitate the Transformations feature for device mode destinations. It ensures that the event ingestion to RudderStack backend isn't affected, assuring minimum response time from the RudderStack backend.
- RudderStack SDK sends the event to the Client Transformation service. It multiplexes the event for different destinations and connects with the transformations attached to these device mode destinations.
- Client Transformation service sends the event to the RudderStack Transformation service to transform the event according to the functions defined in the attached transformations.
- After the transformation is applied, the transformed event is returned to the Client Transformation service.
- Client Transformation service responds to the SDK with the transformed events for all the destinations.
- Finally, the SDK parses the transformed events and forwards them to the specified device-mode destinations.
Further, follow the below steps for setting up the required SDK:
Alternatively, you can use the following snippet with the updated URL:
Install the Android SDK following the detailed steps mentioned in Installing the Android SDK section. Additionally, use the following dependency in the Android app level
Install the iOS SDK following the detailed steps mentioned in Installing the iOS SDK section. Additionally, use the following dependency in
pod 'Rudder', '1.8.0.beta.1'
The following limitations are applicable when invoking a transformation in the device mode:
The network unavailability can lead to higher latency than expected while sending the events to the destinations. RudderStack doesn't lose data due to the network loss and stores the events in the client device until those are successfully delivered to the destination.
The iOS SDK does not support the background processing of an event when the app is closed. However, the pending events are sent the next time the app is opened.
The following memory and time limits must be followed:
Parameter Limit Memory limit 128 MB Execution time limit 4 seconds