SDK Quickstart
Install a Layers SDK and fire your first event.
Pick the package that matches your stack. Every SDK posts to the same
https://in.layers.com/events ingest endpoint.
Get your app ID
Project → Layers → Layers SDK → copy app_id (prefixed app_).
Use this as appId everywhere below.
Web / JavaScript
npm i @layers/clientimport { LayersClient } from '@layers/client';
const layers = new LayersClient({
apiKey: 'unused-but-required-by-type',
appId: 'app_xxx',
environment: 'production',
});
await layers.init();
await layers.track('purchase_success', { revenue: 9.99, currency: 'USD' });React Native
npm i @layers/react-native
cd ios && pod installimport Layers from '@layers/react-native';
await Layers.init({
apiKey: 'unused-but-required-by-type',
appId: 'app_xxx',
environment: __DEV__ ? 'development' : 'production',
});
await Layers.track('purchase_success', { revenue: 9.99, currency: 'USD' });Expo
npx expo install @layers/expoWire the config plugin in app.json, then use the same API as React
Native. Full Expo guide →
Node / server-side
npm i @layers/nodeSame API as @layers/client, runs on Node. Good for post-purchase
webhooks, CRM pipelines, and server-side backfills.
Platforms not yet available
Native iOS, Android, Flutter, Unity, and Cordova / Capacitor SDKs are
not yet published. See the per-platform pages for the current
status and interim workarounds (mostly: use the web or RN SDK, or POST
directly to https://in.layers.com/events).
Validate
After firing your first event:
- Open the Events page in your project and look for it.
- If you have a Meta or TikTok ads layer with CAPI enabled, open Meta Events Manager → Test Events or TikTok's Events Debugger to confirm downstream forwarding. (Note: only events in the event map are forwarded; arbitrary event names are stored but not relayed.)
If nothing appears, see Debugging.
Next
- Standard events — event names that map cleanly to Meta / TikTok standard events.
- User identity —
setAppUserId,setUserProperties. - Initialization options.
- Production checklist.