# Packages and Configuration Options

## SDK packages[](#sdk-packages)

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

Package Product

Required?

Description

CustomerIO

✅

The main SDK package. Used to initialize the SDK and call the SDK’s methods.

CioConfig

✅

Configure the SDK including in-app messaging support.

CioRegion

Used inside the `CioConfig.region` option to declare your region—EU or US.

CioLogLevel

Used inside the `CioConfig.logLevel` option to set the level of logs you can view from the SDK.

CioLocationTrackingMode

Used inside `CioConfig.location` to set the tracking mode. See [location tracking](/integrations/sdk/react-native/tracking/location/) for details.

## Configuration options[](#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.

```javascript
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, // Replace with CioRegion.EU if your Customer.io account is in the EU.
      logLevel: CioLogLevel.Debug,
      trackApplicationLifecycleEvents: true,
      inApp: {
         siteId: 'site_id',
      },
      push: {
         android: {
            pushClickBehavior: PushClickBehaviorAndroid.ActivityPreventRestart
         }
      }
   };
   CustomerIO.initialize(config)
   }, [])
}
```

Option

Type

Default

Description

`cdpApiKey`

string

**Required**: the key you'll use to initialize the SDK and send data to Customer.io

`region`

`CioRegion.EU` or `CioRegion.US`

`CioRegion.US`

****Requires the CioRegion package.** You must set the region your account is in the EU (`CioRegion.EU`).**

`apiHost`

string

The domain you’ll proxy requests through. You’ll only need to set this (and `cdnHost`) if you’re [proxying requests](#proxying-requests).

`autoTrackDeviceAttributes`

boolean

`true`

Automatically gathers information about devices, like operating system, device locale, model, app version, etc

`cdnHost`

string

The domain you’ll fetch configuration settings from. You’ll only need to set this (and `apiHost`) if you’re [proxying requests](#proxying-requests).

`logLevel`

string

`error`

**Requires the `CioLogLevel` package**. Sets the level of logs you can view from the SDK. Set to `debug` or `info` to see more logging output.

`migrationSiteId`

string

**Required 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.

`screenViewUse`

`All` or `InApp`

`All`

`ScreenView.All` (Default): Screen events are sent to Customer.io. You can use these events to build segments, trigger campaigns, and target in-app messages.  
  
`ScreenView.InApp`: Screen view events not sent to Customer.io. You’ll *only* use them to target in-app messages based on page rules.

`trackApplicationLifecycleEvents`

boolean

`true`

Set to `false` if you don't want the app to send lifecycle events

`inApp`

object

**Required for in-app support**. This object takes a `siteId` property, determining the workspace your in-app messages come from.

`push`

object

Takes a single option called `PushClickBehaviorAndroid`. This object and option controls how your app behaves when your Android audience taps push notifications.

`location`

object

Enable [location tracking](/integrations/sdk/react-native/tracking/location/). Takes a `trackingMode` option from the `CioLocationTrackingMode` package.

## Proxying requests[](#proxying-requests)

By default, requests go through our domain at `cdp.customer.io`. You can proxy requests through your own domain to provide a better privacy and security story, especially when submitting your app to app stores.

To proxy requests, you’ll need to set the `apiHost` and `cdnHost` properties in your `SDKConfigBuilder`. While these are separate settings, you should set them to the same URL.

While you need to initialize the SDK with a `cdpApiKey`, you can set this to any value you want. You only need to pass your actual key when you send requests from your server backend to Customer.io. If you want to secure requests to your proxy server, you can set the `cdpApiKey` to a value representing basic authentication credentials that you handle on your own. See [proxying requests](/integrations/data-in/proxying-requests) for more information.

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

const config: CioConfig = {
  cdpApiKey: 'your-cdp-api-key',
  region: CioRegion.US,
  inApp: {
    siteId: 'your-site-id',
  },
  // Proxy requests through your own domain
  apiHost: 'proxy.example.com',
  cdnHost: 'proxy.example.com',
} as CioConfig;

CustomerIO.initialize(config);
```