Packages and Configuration Options
UpdatedThe SDK consists of a few packages. You’ll get the most value out of Customer.io when you use all our packages together, but this lets you omit packages for features you don’t intend to use.
SDK packages
To minimize our SDK’s impact on your app’s size, we’ve split the SDK into packages. You can limit your install to the packages that you need for your project. But, in most cases, you’ll want to install all the packages to get the most value out of Customer.io.
You must install the datapipelines
package. It lets you identify people, which you must do before you can send them messages, etc. You’ll want to add the messaging-push-fcm
and the messaging-in-app
packages to send push notifications and in-app messages respectively.
Package Product | Required? | Description |
---|---|---|
datapipelines | ✅ | Identify people, track events, track anonymous activity |
messaging-push-fcm | Receive push notifications over Google Firebase Cloud Messaging (FCM) | |
messaging-in-app | Receive in-app notifications |
Configuration options
You’ll call configuration options before you initialize the SDK. In most cases, you’ll want to stick with the defaults, but you might do things like change the logLevel
when testing updates to your app—as shown in the example below.
If you’re in our EU region, you must set Region.EU
.
CustomerIOBuilder(
applicationContext = this,
cdpApiKey = "your_cdp_api_key"
).apply {
// If you're in the EU, set Region.EU
Region.US
autoTrackDeviceAttributes(true)
autoTrackActivityScreens(false)
logLevel(CiologLevel.DEBUG)
addCustomerIOModule(
ModuleMessagingInApp(
config = MessagingInAppModuleConfig.Builder(
siteId = "your_site_id",
region = Region.US
).setEventListener(InAppMessageEventListener()).build()
)
)
addCustomerIOModule(ModuleMessagingPushFCM())
build()
}
Option | Type | Default | Description |
---|---|---|---|
cdpApiKey | string | Required: the key you'll use to initialize the SDK and send data to Customer.io | |
migrationSiteId | string | Required if you're updating from 2.x: the credential for previous versions of the SDK. This key is used to send remaining tasks to Customer.io when your audience updates your app. | |
region | .EU or .US | .US | Required if your account is in the EU region. This sets your account region in the format Region.US . |
autoTrackDeviceAttributes | boolean | true | Automatically gathers information about devices, like operating system, device locale, model, app version, etc |
autoTrackActivityScreens | boolean | false | If true, the SDK automatically sends screen events for every screen your audience visits. If you use Jetpack Compose you should set this to false and track screens manually. |
trackApplicationLifecycleEvents | boolean | true | Set to false if you don't want the app to send lifecycle events |
logLevel | string | error | Sets the level of logs you can view from the SDK. Set to debug or info to see more logging output. |