@releaseo/sdk-core
v0.0.14
Published
Host-page runtime for Releaseo.
Readme
@releaseo/sdk-core
Host-page runtime for Releaseo.
This package powers the global window.releaseo API, handles iframe lifecycle, identify/session flows, telemetry, and bridge messaging.
Quick Start
Install the package from npm:
npm install @releaseo/sdk-coreImport the runtime, initialize it with your publish key, then track events or identify users:
import Releaseo from '@releaseo/sdk-core';
Releaseo.init({
publishKey: 'pk_key',
});
// use on inside useEffect and check on isAuth
Releaseo.identify('123', {
email: '[email protected]',
name: 'Test User',
});Public API
init(config)endpoint(nextEndpoint)identify(userId, properties?)open()close()track(eventName, payload?)logout()reset()setMockData(posts)on(eventName, handler)off(eventName, handler)settings(readonly snapshot)
Notable Runtime Behaviors
- Identity persistence with TTL (
identityTtl, default: 30 days) - Silent identity restoration after refresh
- Batched telemetry (
10events or2swindow) - Event rate limiting (
100events per60s, internal SDK events bypass) - Full teardown via
reset()for multi-tenant SPA transitions
