Complete guide for setting up OneSignal Web Push notifications using custom code integration. Configure JavaScript SDK, service workers, and Safari certificates for Chrome, Firefox, Safari, and other web browsers.
OneSignal dashboard showing the initial app creation screen
Platform selection screen showing Web option highlighted
Web configuration options with Custom Code selected
Site setup form with required fields highlighted
Field | Description | Requirements |
---|---|---|
SITE NAME | Display name shown in push notifications | Keep it concise and recognizable |
SITE URL | Your complete website URL | Must include https:// and match exactly (include www if used) |
AUTO RESUBSCRIBE | Automatically resubscribes returning users | Recommended: Helps maintain subscriber count |
DEFAULT ICON URL | Icon for prompts and notifications | Square 256x256 pixels, .png/.jpg/.gif format, HTTPS URL required |
www
)Safari certificate upload option for existing certificates
Safari Web .p12 Push Certificate
and enter the password.
Click Save to continue.
Option 1: Create File Manually (Recommended)
OneSignalSDKWorker.js
Option 2: Download and Upload
OneSignalSDKWorker.js
to your serverhttps://yoursite.com/OneSignalSDKWorker.js
Custom Location: If you need to place the file in a subfolder, see our OneSignal Service Worker Guide for detailed instructions.
Service worker file download interface
OneSignalSDKWorker.js
and OneSignalSDKUpdaterWorker.js
), continue hosting both files to prevent service worker issues.New setups only require the single OneSignalSDKWorker.js
file.<head>
section. Replace YOUR_ONESIGNAL_APP_ID
with your actual App ID from the OneSignal dashboard.
OneSignalSDKWorker.js
is accessible at the correct URL<head>
sectionsupport@onesignal.com
for assistance.