Troubleshooting
init() throws immediately
The CDN bundle’s init() throws [1Sygnal] apiKey is required in init(). or
[1Sygnal] apiUrl is required in init options. synchronously (well, the function is
async, so as a rejected Promise) if either is missing. Unlike the natives, web has no
default apiUrl — you must pass one.
await oneSygnal.init(...) resolved immediately, but surveys aren’t showing
If you’re on the npm loader, init() returns void, not a Promise — awaiting it
doesn’t wait for anything. The bundle loads asynchronously in the background; there’s no
ready event on web to await instead (see Events). If you’re
loading the CDN bundle directly, its init() genuinely does return Promise<void>
that resolves once initialization completes — check you’re not accidentally mixing the two
distribution channels.
A call I made right after init() returned undefined
If you’re on the loader, calls made before the bundle finishes loading are queued and
their results are unobservable — there’s nothing yet to produce a return value.
on() returns undefined instead of a Registration; areSurveysEnabled() returns
undefined instead of a boolean. This is queuing behavior, not a bug — the call itself
(other than reads) still gets replayed against the bundle once it’s ready.
Script tag auto-init isn’t firing
Two silent failure modes:
srcdoesn’t contain the substringonesygnal. Auto-init only scans<script data-api-key="...">tags whosesrcmatches that substring. Renaming or proxying the script URL to something that doesn’t containonesygnalbreaks auto-init with no console output.data-api-urlis missing. Auto-init silently stops (no error, no init call) ifdata-api-keyis present butdata-api-urlisn’t.
Bundle failed to load
If the <script> tag’s request fails (network, blocked CDN, ad blocker), the loader logs
[1Sygnal] Failed to load SDK bundle from <url> to the console via console.warn and
resets its internal “bundle loaded” flag, so a later init() call will retry the
injection. Queued calls from before the failure remain queued.