Layers

SDK Quickstart

Install a Layers SDK and fire your first event.

View as Markdown

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/client
import { 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' });

Full web guide →

React Native

npm i @layers/react-native
cd ios && pod install
import 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' });

Full RN guide →

Expo

npx expo install @layers/expo

Wire the config plugin in app.json, then use the same API as React Native. Full Expo guide →

Node / server-side

npm i @layers/node

Same 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:

  1. Open the Events page in your project and look for it.
  2. 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

On this page