SDK — Cordova / Capacitor
Status of the hybrid-app SDKs. Currently unpublished.
Status: not yet published. cordova-plugin-layers does not exist on
npm, and @layers/capacitor is not published. The previous content on
this page described a planned API, not a real package.
What exists today
For Cordova and Capacitor apps, the supported path is the Web SDK:
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' });This runs in the WebView process, which is sufficient for event tracking on most hybrid apps. Native features like iOS ATT and Android install referrer are NOT available through the web SDK; for those you would need first-party native bindings (not yet published).
Roadmap
A Capacitor plugin is a plausible future deliverable but is not on a committed roadmap. If you have a hard dependency on one, let the team know via support.
If you need hybrid now
- Use
@layers/clientinside the WebView (works in Capacitor 5/6 and Cordova without modification). - For anything requiring native APIs (ATT, install referrer, Keychain), integrate a native helper yourself and call it from the WebView.