Self-Hosted Web Push Integration Guide

Self-Hosted Web Push Integration Guide

To enable native web push notifications on your website, follow these simple integration steps:

Step 1: Download your SDK Bundle

Go to your Websites Dashboard, find your registered website, and click the Download SDK button. This will download a pre-configured .ZIP package containing:

  • sdk.js (pre-compiled with your dynamic site key and backend URL)
  • sw.js (our standard background service worker)

Step 2: Upload Files to your Server Root

Extract the .ZIP package and upload both sdk.js and sw.js directly into the root directory of your website (usually named public_html, public, or www).

Ensure they are publicly accessible in your browser at:

  • https://yoursite.com/sdk.js
  • https://yoursite.com/sw.js

[!IMPORTANT] Web browsers require the service worker (sw.js) to be hosted exactly at the root of your domain. If placed in a subdirectory, the browser will restrict its security scope and notifications will fail.


Step 3: Paste the Integration Script

Copy and paste this single script tag inside the <head> of your website:

<script src="/sdk.js" defer></script>

Step 4: Verify & Test

  1. Clear your browser cache and open your website.
  2. Tap or click anywhere on the page—the browser's native notification prompt will automatically slide down!
  3. Click Allow. Your device will now appear under the Subscribers list in your dashboard, ready to receive live push campaigns.