Use Push Relay in your own app
Drop it in as your notification backend. Auth is a per-app key pair: a
browser-safe publishable key (ppk_…) that only registers
subscriptions, and a backend-only secret key (psk_…) that sends.
Two small SDKs do the work.
The owner provisions an app (with your site's origins allow-listed for the browser-direct path) and hands you the pair — or grab a scoped, 24-hour demo key from the Keys page to try it.
@bilalhasson/push-relay-browser registers the Service
Worker, asks permission, subscribes, and registers the subscription:
npm install @bilalhasson/push-relay-browser
import { PushRelayClient } from "@bilalhasson/push-relay-browser";
const client = new PushRelayClient({ baseUrl: location.origin, publishableKey: "ppk_…" });
await client.subscribe("user-123");
Publishable key → straight to Push Relay. Your origin must be allow-listed (CORS). No backend needed to subscribe.
Give the client a registerUrl;
it posts the subscription to your backend, which relays it. No CORS.
With the secret key (never in the browser) — Node or Python:
// Node — @bilalhasson/push-relay
await new PushRelay(baseUrl, "psk_…").send("user-123", { title: "Hello", body: "It works" });
# Python — push-relay
PushRelay(base_url, "psk_…").send("user-123", title="Hello", body="It works")
Published on npm — full API + options in the browser, Node, and Python SDK READMEs.