Quickstart
Get your API key from your project settings at dash.1sygnal.app .
npm install onesygnal-web-sdkimport oneSygnal from 'onesygnal-web-sdk';
oneSygnal.init('YOUR_API_KEY');
oneSygnal.track('page_viewed', { path: window.location.pathname });
oneSygnal.identify('user_123', { plan: 'pro' });That’s it — surveys matching your active trigger rules will show automatically. See Configuration for the full options table.
init() on the loader returns void, not a Promise — there’s no await here because
awaiting it wouldn’t tell you anything about readiness. If you need to know when the SDK
is actually ready, see Events (web has no ready event; the
nearest equivalent depends on which artifact you’re using).