initialiseZeoCollect(options) accepts an options object that’s forwarded to both native SDKs. Keys are snake_case strings; values are typed below.
import { initialiseZeoCollect } from 'zeo-collect';
initialiseZeoCollect({
android_write_key: "YOUR_ANDROID_WRITE_KEY",
ios_write_key: "YOUR_IOS_WRITE_KEY",
use_consent: true,
check_for_cmp: true,
hash_identities: true,
user_country: "deu"
});
Core options
| Key | Type | Default | Description |
|---|
android_write_key | String | — | Write key from the Android Source. |
ios_write_key | String | — | Write key from the iOS Source. |
opt_out | Boolean | false | Master kill switch. If true, no events are posted. Used as a fallback when consent is not used. |
logging | Boolean | false | If true, displays info / debug / warning / error logs. Otherwise only warning + error. |
Consent
| Key | Type | Default | Description |
|---|
use_consent | Boolean | false | If true, the package waits for a consent signal before recording. |
check_for_cmp | Boolean | false | If true (with use_consent), the package reads TCF data stored by other CMPs. |
check_zeotap_vendor_consent | Boolean | false | If true, requires Zeotap Vendor consent when resolving GDPR consent. |
purposes_for_tracking | number[] | [1, 3, 4] | TCF purpose IDs that gate tracking. See TCF policies. |
purposes_for_identify | number[] | [1, 9] | TCF purpose IDs that gate identification. |
For the full consent walkthrough see Consent Resolution.
Identity & hashing
| Key | Type | Default | Description |
|---|
are_identities_hashed | Boolean | false | Set true if your setUserIdentities calls already supply hashed PII keys (email_sha256_lowercase, etc.). |
hash_identities | Boolean | false | If true, raw PII passed to setUserIdentities is hashed by the package before being sent. |
Both flags apply only to PII fields. Custom identities (crmID, etc.) are always sent as-is.
Event delivery
| Key | Type | Default | Description |
|---|
batch_size | Integer | 30 | Max events in the unsent queue before next batch dispatches. Min 10, max 50. |
max_cache_size | Integer | 100 | Max events stored locally during network failures or delayed consent. Max 200. |
service_interval | Integer | 90 | Seconds between scheduled dispatches when the queue is below the batch threshold. |
Region
| Key | Type | Default | Description |
|---|
user_country | String | null | Alpha-ISO3 country code sent as user.user_country. Defaults to IP-derived country when omitted. |
A complete example
import { initialiseZeoCollect } from 'zeo-collect';
initialiseZeoCollect({
android_write_key: "YOUR_ANDROID_WRITE_KEY",
ios_write_key: "YOUR_IOS_WRITE_KEY",
opt_out: false,
logging: false,
use_consent: true,
check_for_cmp: false, // custom consent flow
hash_identities: true,
are_identities_hashed: false,
batch_size: 30,
max_cache_size: 100,
service_interval: 90,
user_country: "deu",
purposes_for_tracking: [1, 3, 4],
purposes_for_identify: [1, 9]
});
Init callback
initialiseZeoCollect accepts an optional second-argument callback that receives {status, message}:
initialiseZeoCollect(options, (data) => {
console.log("Init status:", data.status, data.message);
});