Packages and Configuration Options

Updated

SDK packages

The SDK consists of a few packages. You must use the CioConfig and CustomerIO packages to configure and initialize the SDK.

Package ProductRequired?Description
CustomerIOThe main SDK package. Used to initialize the SDK and call the SDK’s methods.
CioConfigConfigure the SDK including in-app messaging support.
CioRegionUsed inside the CioConfig.region option to declare your region—EU or US.
CioLogLevelUsed inside the CioConfig.logLevel option to set the level of logs you can view from the SDK.

Configuration options

You can determine global behaviors for the SDK in using CioConfig package. You must provide configuration options before you initialize the SDK; you cannot declare configuration changes after you initialize the SDK.

Import CioConfig and then set configuration options to configure things like your logging level and whether or not you want to automatically track device attributes, etc. Note that the logLevel option requires the CioLogLevel package and the region option requires the CioRegion package.

import {
  CioLogLevel, CioRegion, CustomerIO, CioConfig
} from 'customerio-reactnative';

const App = () => {

useEffect(() => {
   const config: CioConfig = {
      cdpApiKey: 'CDP API Key', // Mandatory
      migrationSiteId: 'siteId', // Required if migrating from an earlier version
      region: CioRegion.US,
      logLevel: CioLogLevel.Debug,
      trackApplicationLifecycleEvents: true,
      inApp: {
         siteId: 'site_id',
      },
      push: {
         android: {
            pushClickBehavior: PushClickBehaviorAndroid.ResetTaskStack
         }
      }
   };
   CustomerIO.initialize(config)
   }, [])
}
OptionTypeDefaultDescription
cdpApiKeystringRequired: the key you'll use to initialize the SDK and send data to Customer.io
migrationSiteIdstringRequired if you're updating from 3.x: the credential for previous versions of the SDK. This key lets the SDK send remaining tasks to Customer.io when your audience updates your app.
regionCioRegion.EU or CioRegion.USCioRegion.USRequires the CioRegion package. You must set the region your account is in the EU (CioRegion.EU).
autoTrackDeviceAttributesbooleantrueAutomatically gathers information about devices, like operating system, device locale, model, app version, etc
trackApplicationLifecycleEventsbooleantrueSet to false if you don't want the app to send lifecycle events
logLevelstringerrorRequires the CioLogLevel package. Sets the level of logs you can view from the SDK. Set to debug or info to see more logging output.
inAppobjectRequired for in-app support. This object takes a siteId property, determining the workspace your in-app messages come from.
pushobjectTakes a single option called PushClickBehaviorAndroid. This object and option controls how your app behaves when your Android audience taps push notifications.
Copied to clipboard!
  Contents
Current release
 4.0.1
Is this page helpful?