Skip to Content
PlatformsWebConfiguration

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():

OptionTypeDefaultNotes
apiUrlstringRequired. init() throws [1Sygnal] apiUrl is required in init options. without it.
debugbooleanfalse
autoTrackbooleantrueAutomatic page_view/page_leave/session events.
exitIntentbooleantrueExit-intent trigger detection.
consentRequiredbooleanfalseWhen true, surveys start disabled (setSurveysEnabled(false)) until you explicitly enable them.
cssUrlstringAuto-derived from the bundle’s own script src (onesygnal.jsonesygnal.css)Only relevant when loading the CDN bundle directly.
localestringnavigator.languageSent as Accept-Language. Fixed at init() time — unlike the natives’ setLocale(), which is live-reactive and re-fetches config under the new locale.
disableThrottlingbooleanfalseBypasses 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 is init()’s argument.
  • setLocale() — web’s locale is fixed at init() 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.