Guides
How to add push notifications to a website
Everything a site needs before it can send its first browser notification, with the exact files and where they go.
Short answerYou need HTTPS, a service worker file on your domain, an opt-in prompt that asks for permission, and a server (or service) that stores subscriptions and sends messages. With SuperWicket that is one script tag and one one-line file. If you can’t upload files, use a hosted subscribe page instead.
What your site needs
- HTTPS. Browsers only allow push on secure pages. Most hosts give you a free certificate.
- A service worker file on your own domain. It must come from the same origin as your pages, ideally the root (
https://example.com/superwicket-sw.js), so it can cover every page. - A way to add a script tag to every page: your theme header, a tag manager, or your framework’s base layout.
- A sender that stores subscriptions and sends messages: your own server, or a service.
If your platform won’t let you put a file at the root of your domain (Squarespace, Webflow, Blogger, Shopify, Wix without code), skip to no file access.
Step-by-step setup with SuperWicket
- Create a website. Sign up, add your site’s address, and SuperWicket generates a VAPID key pair for it. If you are moving from another provider, import your existing key pair here so current subscribers keep working (how).
- Upload the service worker. Download
superwicket-sw.jsfrom the install screen and upload it to the root of your site, next to your home page’sindexfile. It contains a single line:
OpenimportScripts('https://superwicket.com/p/sw/YOUR_PIXEL_KEY.js');https://your-site.com/superwicket-sw.jsin a browser to check it loads as JavaScript, not as an HTML error page. - Add the script tag to the
<head>of every page:
The install screen checks for you whether both the script and the service worker are reachable.<script async src="https://superwicket.com/p/YOUR_PIXEL_KEY.js"></script> - Choose an opt-in widget. Pick a bell, slide-in, modal or inline button and when it appears (after a scroll, a delay, or on exit intent). Don’t show the browser’s permission box on page load; see opt-in best practices.
- Subscribe yourself and send a test. Open your site, accept the prompt, and send a test from the dashboard. Then send your first campaign.
Platform-specific instructions
- WordPress: the file goes in the same folder as
wp-config.php. - HTML, React, Next.js, Netlify, Vercel: the file goes in your public or static folder.
- Shopify, Wix, Squarespace, Webflow, Blogger: these need a workaround or the hosted page.
If you can’t upload files: the hosted subscribe page
Browsers insist the service worker comes from the same domain as the page that asks for permission. If your platform won’t serve your file from your domain, visitors can’t subscribe on your pages. Instead, SuperWicket hosts a subscribe page for you at superwicket.com/s/your-name, with your logo and text. Link to it from a button, banner or menu item. Subscribers who opt in there receive your notifications like any other. Read more about the hosted subscribe page.
If your site already has a service worker
A scope can only have one service worker. If you already register one (for a PWA or offline caching), don’t add a second file. Add this line at the top of your existing worker instead, and set SuperWicket’s service worker path to that file in the website settings:
importScripts('https://superwicket.com/p/sw/YOUR_PIXEL_KEY.js');
Check that it works
- In Chrome DevTools, open Application, then Service workers. You should see your worker as activated and running.
- After subscribing, the dashboard shows you as a subscriber with your browser and country.
- If the test notification doesn’t appear, work through the troubleshooting checklist, or confirm your browser can receive push at all with the push tester.
Doing it without a service
You can build all of this yourself with the Push API and an open-source library such as web-push for Node or minishlink/web-push for PHP. You will need to store subscriptions, remove expired ones, encrypt payloads, handle retries and rate limits, and build your own prompt, scheduling and reporting. Our service worker example and VAPID key generator cover the browser side.
Frequently asked questions
Can I add push notifications without coding?
Mostly. You paste one script tag into your site’s header and upload one small file. On builders that block file uploads (Squarespace, Webflow, Blogger), share a hosted subscribe page instead. That needs no code at all.
Does my site need HTTPS?
Yes. Browsers only allow service workers and the push permission prompt on secure (HTTPS) pages. localhost is the one exception, for testing.
Where does the service worker file have to go?
At the root of your domain (for example https://example.com/superwicket-sw.js) so it can control every page. A subfolder works only for pages inside that folder, unless the server sends a Service-Worker-Allowed header.
How long does setup take?
Usually a few minutes if you can edit your site header and upload a file. Most of the time goes into choosing the prompt and writing the first message.
Try it on your own site
The Free plan has no time limit and needs no card. Add one script tag, or share a hosted subscribe page if you can’t upload files.