Guides

How to move web push subscribers to a new provider

The part every migration guide skips: whether you keep your subscribers depends on who holds the private key.

Short answerA push subscription works only with the VAPID key pair it was created with. To keep subscribers, you need your current provider’s public and private VAPID keys plus an export of each subscription (endpoint, p256dh and auth). Import both into the new service and replace the service worker. If the old provider won’t release the private key, you have to re-subscribe visitors gradually.

Why the keys decide everything

Every push subscription is created against one VAPID public key. Only the matching private key can sign pushes that the browser’s push service accepts (VAPID explained). So when you switch provider, there are two cases:

  • You can get the old key pair (public and private). Import it into the new service with your subscriptions, and subscribers move with no new prompt.
  • You can’t get the private key. The old subscriptions can’t be used by anyone else. You re-subscribe visitors as they come back. Because browser permission belongs to your domain, not to the provider, visitors who already allowed notifications are usually subscribed again without seeing a prompt.

Before you start

  • Ask your current provider’s support whether they will give you the VAPID private key and a subscription export. Some do; some treat the key as theirs. Ask before you cancel anything.
  • Note where the old service worker lives (its path and scope). Keeping the same scope avoids two workers competing.
  • Plan a quiet period: don’t send from both providers during the switch.

Migration steps (with the key pair)

  1. Get the keys. You need the public key (87 characters, starts with B) and the private key (43 characters).
  2. Export subscriptions. Each record needs the endpoint URL and the two subscription keys, p256dh and auth. These keys are not the VAPID keys; they belong to each browser. Some exports call them web_p256 and web_auth.
  3. Create the website in SuperWicket and choose “Import an existing key pair”. Paste both keys. We check that they form a valid pair before saving.
  4. Import the subscriber file (CSV or JSON) from the Subscribers screen. The file needs endpoint, p256dh and auth columns (rename web_p256 and web_auth if your export uses those). Columns named custom.something become custom fields you can segment on.
  5. Swap the code on your site. Remove the old provider’s script and service worker, add the SuperWicket script, and put our service worker at the same path the old one used (you can set the path in website settings), or at the root.
  6. Test, then switch off the old provider. Subscribe a fresh browser, send to yourself, then send a small campaign to imported subscribers and watch the delivery log. Expect some imported subscriptions to come back as expired (404/410): they had already gone stale at the old provider and are removed automatically.

Without the key pair

  1. Create the website in SuperWicket with new keys.
  2. Replace the old script and service worker with ours, at the same path if possible, so the browser swaps workers cleanly.
  3. On each return visit, our script finds that permission is already granted, replaces the old provider’s subscription with one tied to your new keys, and saves it. No prompt is shown.
  4. Keep the old provider running for a few weeks if it allows sending without its script, and announce the switch once. Then cancel it.

Your list rebuilds at the pace of returning visitors. Frequent readers come back within days; occasional visitors may take weeks.

Notes for common providers

  • OneSignal: subscriptions can be exported via their CSV export API with the web_auth and web_p256 fields. Whether you can get the VAPID private key depends on their support; recent reports say it is often refused. See SuperWicket vs OneSignal.
  • Firebase Cloud Messaging (web): if you generated the key pair yourself and imported it into Firebase, you already have it. If Firebase generated it, the private key isn’t exportable.
  • Self-hosted (web-push, minishlink/web-push): you own the keys and the subscription table. Export them directly.

After the move

Compare sent and displayed counts for the first few campaigns. A big gap usually means many imported subscriptions were stale. Keep your key pair backed up. If you ever move again, you’ll need it, and SuperWicket lets you export your subscribers at any time.

Frequently asked questions

Can I move subscribers from OneSignal?

Only if you can get the VAPID private key for your OneSignal web app. Ask their support. Without it, existing subscriptions can’t be signed by another service and visitors must subscribe again.

Will subscribers see a new permission prompt after migration?

Not if you import the same key pair and keep the service worker at the same scope. The browser keeps the existing permission and subscription.

What if I can’t get the old keys?

Install SuperWicket with new keys and remove the old provider’s code. Returning visitors who had already allowed notifications are subscribed again without a prompt, because the permission is per site, not per provider.

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.