Skip to main content
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

KeyTypeDefaultDescription
android_write_keyStringWrite key from the Android Source.
ios_write_keyStringWrite key from the iOS Source.
opt_outBooleanfalseMaster kill switch. If true, no events are posted. Used as a fallback when consent is not used.
loggingBooleanfalseIf true, displays info / debug / warning / error logs. Otherwise only warning + error.
KeyTypeDefaultDescription
use_consentBooleanfalseIf true, the package waits for a consent signal before recording.
check_for_cmpBooleanfalseIf true (with use_consent), the package reads TCF data stored by other CMPs.
check_zeotap_vendor_consentBooleanfalseIf true, requires Zeotap Vendor consent when resolving GDPR consent.
purposes_for_trackingnumber[][1, 3, 4]TCF purpose IDs that gate tracking. See TCF policies.
purposes_for_identifynumber[][1, 9]TCF purpose IDs that gate identification.
For the full consent walkthrough see Consent Resolution.

Identity & hashing

KeyTypeDefaultDescription
are_identities_hashedBooleanfalseSet true if your setUserIdentities calls already supply hashed PII keys (email_sha256_lowercase, etc.).
hash_identitiesBooleanfalseIf 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

KeyTypeDefaultDescription
batch_sizeInteger30Max events in the unsent queue before next batch dispatches. Min 10, max 50.
max_cache_sizeInteger100Max events stored locally during network failures or delayed consent. Max 200.
service_intervalInteger90Seconds between scheduled dispatches when the queue is below the batch threshold.

Region

KeyTypeDefaultDescription
user_countryStringnullAlpha-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);
});
Last modified on June 22, 2026