Skip to Content
PlatformsWebOverview

Web SDK

The Web SDK ships as two artifacts, and which one you’re looking at changes what the API actually does:

  • The loader (onesygnal-web-sdk on npm, current version 0.1.0) — a ~100-line script that injects a <script> tag pointing at the hosted bundle and queues calls until it’s ready. This is what you get from npm install.
  • The CDN bundle (https://sdk.1sygnal.app/js/onesygnal.js) — the actual survey engine. You get this automatically when using the loader, or you can load it directly with a <script> tag and skip the loader entirely.

The two have different method signatures for the same calls — see API Reference for exactly which. If you’re debugging “why did my await resolve immediately,” this is almost always why: you’re on the loader, and the loader’s init() isn’t a Promise.

Distribution model

ChannelPackageNotes
npmonesygnal-web-sdkDefault export only — no named exports.
CDNhttps://sdk.1sygnal.app/js/onesygnal.jsLoaded directly, or injected by the loader.

Platform floors

Runs in any browser with <script> tag and fetch support. No framework dependency — works in a plain HTML page, and equally in a React/Vue/etc. app via the npm package.