Configuration
API key
Passed directly as init()’s first argument — there’s no separate setApiKey() on web.
oneSygnal.init('YOUR_API_KEY', options);Options
Passed as the second argument to init():
| Option | Type | Default | Notes |
|---|---|---|---|
debug | boolean | false | |
autoTrack | boolean | true | Automatic page_view/page_leave/session events. |
exitIntent | boolean | true | Exit-intent trigger detection. |
consentRequired | boolean | false | When true, surveys start disabled (setSurveysEnabled(false)) until you explicitly enable them. |
cssUrl | string | Auto-derived from the bundle’s own script src (.../js/1sygnal.js → .../css/1sygnal.css) | Only relevant when loading the CDN bundle directly. |
locale | string | navigator.language | Sent as Accept-Language. Fixed at init() time — unlike the natives’ setLocale(), which is live-reactive and re-fetches config under the new locale. |
disableThrottling | boolean | false | Bypasses the server-configured cooldown/daily cap. For local dev and test harnesses only. |
Debug logging
Set debug: true in the options to enable verbose logging to the browser console during
development:
oneSygnal.init('YOUR_API_KEY', { debug: true });This logs SDK lifecycle events, trigger evaluations, and network requests. Disable it in production.
What’s absent on web
reset(), setApiKey(), and setLocale() exist on Android/iOS but not on web:
reset()— deferred; web has never distinguished “clear the identified user” from “mint a new anonymous ID.”setApiKey()— no separate override method; the key isinit()’s argument.setLocale()— web’s locale is fixed atinit()time by design; making it live-reactive like the natives is a product decision that hasn’t been made.
See the full Platform Parity table for every operation.