Configuration
API key
Passed directly as init()’s first argument — there’s no separate setApiKey() on web
(the natives read it from AndroidManifest.xml/Info.plist and also expose a
setApiKey() override; web’s API design takes it as an argument instead, so there’s no
override method to mirror).
oneSygnal.init('YOUR_API_KEY', options);Options
Passed as the second argument to init():
| Option | Type | Default | Notes |
|---|---|---|---|
apiUrl | string | — | Required. init() throws [1Sygnal] apiUrl is required in init options. without it. |
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 (onesygnal.js → onesygnal.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. |
Unlike the natives, which default to https://sdk-api.1sygnal.app with zero config, web
has no default apiUrl and will throw without one.
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.