Developers · Web
Web push SDK
Web push uses the same message, the same composer and the same report as mobile push. A browser becomes a subscriber the way a phone does: it registers with your account and reports its language, time zone and permission. You add a service worker file to your site, start the SDK, and ask for permission when someone clicks.
Push APIservice worker on your originVAPID key pair per projectpermission after a user gesture
Last updated · Ask the docs, or a person
A laptop on a wooden table in a sunlit living room. On its screen, a browser shows a German web push from lingora.example: “Deine Lektion wartet.”
01
Four parts, all standard
Web push isn't one vendor's system. It is a set of open web standards, and every browser that supports it follows the same shape.
- A service worker. A script your site registers. The browser can wake it to show a notification even when no tab of your site is open.
- A push subscription. When someone allows notifications, the browser's own push service gives your page an endpoint URL and keys for that browser.
- VAPID keys. A key pair that identifies the sender to the push service. The public key goes to the browser; the private key never leaves the server (RFC 8292).
- An encrypted message. The server encrypts each push for that one browser and sends it to the endpoint. The browser wakes the service worker, which shows the notification (MDN: Push API).
- click → permission your sitepage
- service workeron your origin
- browser push serviceone per browser vendor
- your Oricato accountVAPID private key
- 1subscribe (VAPID public key)
- 2subscription endpoint → account
- 3encrypted push → endpoint
- 4wake → show notification
Four parts. Your site's page subscribes with the VAPID public key after a click grants permission. The subscription endpoint goes to your Oricato account, which holds the VAPID private key. The account sends an encrypted push to the browser push service's endpoint. The push service wakes the service worker on your origin, which shows the notification.
What you add to your site
Three things, and none of them asks for permission on page load.
- The service worker file, served from your own origin, so its scope covers the pages that subscribe. The setup guide gives you the file and the path.
- The SDK script, started on every page load, with your Project ID and your account's API address, the same two values a mobile app uses. Starting it never prompts.
- A clear button that asks for permission when someone presses it, for example "Get a reminder when your daily lesson is ready".
// On every page load: start the SDK. It does not prompt.
Oricato.initialize({
projectId: "<ORICATO_PROJECT_ID>",
apiBaseUrl: "<ORICATO_API_ADDRESS>",
});
// Only after a click: ask for permission.
document.querySelector("#remind-me").addEventListener("click", async () => {
const status = await Oricato.requestPermission();
// "granted", "denied" or "default"
}); The code shows the order of the setup. Start the SDK on load, and ask for permission only inside a click handler.
Lingora
Lesson 12 · Spanish, A2
Ordering at a café
You finished today's lesson. The next one opens tomorrow morning.
Browser permission prompt (drawn, not a screenshot)
lingora.example wants to show notifications
The prompt appears only after the press.
A Lingora lesson card with the button “Remind me when tomorrow's lesson is ready”. After the press, a neutral gray box stands for the browser's own permission prompt, labeled as a drawing, not a screenshot.
03
Ask once, after a click
Browsers and people both punish prompts that appear on page load. Many browsers quiet or block them, and a person who clicks "Block" rarely goes into settings to undo it. Ask when the value is obvious, from a button the person chose to press.
- Never on page load, never in a pop-up that blocks the page, never more than once per visit.
- Explain the benefit in the button, not in a modal after the prompt.
- If someone blocked notifications, show how to turn them back on in their browser's site settings, and stop asking.
oricato.com never asks you for notification permission.
How to ask for push permission without burning your one chance
04
The same model as your apps
- One composer. Mobile push, web push and email sit in the same message, with one set of translations.
- Language. The SDK reports the language your site shows, and each person gets the translation for it, with the same fallback rules as mobile.
- Local time. The browser's IANA time zone comes from
Intl.DateTimeFormat().resolvedOptions().timeZone, so a 9:00 AM local-time send means 9:00 AM for that person. - Your own IDs and tags. Set a pseudonymous user ID and tags the same way you do in the apps, so one audience rule can cover phones and browsers.
- One report. Sent, Delivered and Opened per message, by country, language and channel.
- Daily limit per subscriber. A browser is a subscriber of its own, with the same daily limit as an app on a phone.
Lingora · lingora.example · jetzt
Deine Lektion wartet
Fünf Minuten heute, und deine Serie bleibt.
The composer with three equal channels, mobile push, web push and email, and beside it a browser window showing the German web push: “Deine Lektion wartet. Fünf Minuten heute, und deine Serie bleibt.” from lingora.example.
05
Web push on iPhone and iPad
Since iOS and iPadOS 16.4, Safari supports web push for web apps that a person has added to their Home Screen. The permission request must come from a user action, such as a tap on a button (WebKit). A site opened in a Safari tab on iPhone can't ask. If your audience is mostly on iPhone, your native app or email may reach them more often.
- Add a web app manifest so people can add your site to their Home Screen.
- Show the "Remind me" button only when the page runs as a Home Screen web app.
06
Keys stay on your account
Each project has its own VAPID key pair. The public key is the only part a browser sees. The private key stays on your dedicated account, encrypted at rest like your push keys. Subscriptions are pseudonymous: the browser's push endpoint, its language and time zone, and the IDs and tags you set, never a name.