Version:

sourceConfigurationOverride Parameter Reference

Reference for the sourceConfigurationOverride parameter used for dynamically configuring device mode destinations in the RudderStack JavaScript SDK.

This guide provides a detailed reference for the sourceConfigurationOverride parameter used for dynamically configuring device mode destinations in the RudderStack JavaScript SDK.

Overview

The sourceConfigurationOverride option of the JavaScript SDK’s load API lets you dynamically modify destination configurations and toggle their active status when initializing the RudderStack JavaScript SDK. This parameter provides programmatic control over device mode destinations without requiring dashboard configuration changes.

See How to Dynamically Configure Device Mode Destinations for more information on using this parameter.

sourceConfigurationOverride structure

{
  sourceConfigurationOverride: {
    destinations: [
      {
        id: string,           // Required
        enabled: boolean,     // Optional
        config: object        // Optional
      }
    ]
  }
}

The destinations array

The destinations array contains objects that specify which destinations to override and how to modify them. Each object in the array contains the following properties:

ParameterTypeDescription
id
Required
StringThe unique identifier of the destination configured in your RudderStack dashboard
enabledBooleanControls whether the destination is active. RudderStack ignores any value other than true or false and the destination configuration remains unchanged.
configObjectConfiguration properties to override for the destination

The config object

The config object contains destination-specific configuration properties that override the corresponding values from the RudderStack dashboard configuration.

Note that different destinations support different configuration properties. Some examples are listed in the below table:

DestinationConfiguration propertiesExample values
Google Analytics 4measurement_idG-XXXXXXXXXX
Facebook Pixelpixel_id1234567890123456
info
The configuration fields may change over time as destinations are updated. Verify the current field names in the source configuration response before implementing the overrides.

Configuration merging strategy

The SDK merges the configuration overrides specified in the sourceConfigurationOverride parameter with the source configuration from RudderStack using the following rules:

  • Only explicitly overridden fields are changed—all other configuration values are inherited from the dashboard configuration.
  • Override values can change the data type of a property (for example, string to object).
  • Setting a field to null or undefined removes it from the final configuration. RudderStack does not perform any further validation.


Questions? Contact us by email or on Slack