Configuration — React Native SDK
Pass options via OpenCDPConfig in OpenCDPSDK.initialize({ config }).
Core
| Field | Type | Default | Description |
|---|---|---|---|
cdpApiKey | string | required | Workspace API key |
cdpEndpoint | string | https://api.opencdp.io/gateway/data-gateway | Primary data-gateway base URL |
cdpFallbackEndpoints | string[] | https://api.open-cdp.com/gateway/data-gateway, https://api.open-cdp.xyz/gateway/data-gateway | Failover gateway base URLs, tried in order after the primary |
cdpRequestTimeout | number | 30000 | Per-host wait in milliseconds (30 seconds). Values outside 5000–120000 are clamped to that range. |
debug | boolean | false | Verbose SDK logging |
throwErrorsBack | boolean | false | Throw on validation/API errors |
Tracking
| Field | Default | Description |
|---|---|---|
autoTrackScreens | false | Native screen auto-tracking |
trackApplicationLifecycleEvents | false | App foreground/background events |
autoTrackDeviceAttributes | false | Register device on init when token available |
In-app
| Field | Default | Description |
|---|---|---|
enableInAppMessages | false | Automatic in-app delivery |
enableInAppRealtime | false | SSE realtime sync |
inAppSyncLimit | 10 | Max messages per sync |
Customer.io dual-write
| Field | Description |
|---|---|
sendToCustomerIo | Mirror identify/track/register to Customer.io |
customerIo / customerIoConfig | Customer.io credentials (native passthrough) |
Gateway request timeout
cdpRequestTimeout is in milliseconds. The built-in default is 30000 (30 seconds). The SDK clamps any value below 5000 up to 5 seconds, and any value above 120000 down to 120 seconds.
The timeout is how long the SDK waits for one gateway host to answer a single request. On a timeout, a network error, or a non-success status, the SDK tries the next host immediately:
https://api.opencdp.io/gateway/data-gatewayhttps://api.open-cdp.com/gateway/data-gatewayhttps://api.open-cdp.xyz/gateway/data-gateway
Leave cdpRequestTimeout unset to keep the 30 second default. To wait 20 seconds on each host, pass 20000.
Example
await OpenCDPSDK.initialize({
config: {
cdpApiKey: 'YOUR_CDP_API_KEY',
cdpEndpoint: 'https://api.opencdp.io/gateway/data-gateway',
cdpRequestTimeout: 20000, // 20 seconds per host
debug: true,
throwErrorsBack: true,
autoTrackDeviceAttributes: true,
enableInAppMessages: true,
enableInAppRealtime: true,
inAppSyncLimit: 10,
},
shouldReinitialize: false,
});