Quickstart: web push in ~10 minutes
By the end of this page a real notification from your Notibase app will land on your own screen. Web push first because it needs no app store — mobile is two credential uploads away.
1 · Create an app & keys
Sign in at the dashboard (GitHub or Google), create an organization and an app, then in Setup:
| Generate VAPID keys | Notibase manages web-push crypto per app — you never touch it. |
| Mint a client key ck_live_… | Ships in your frontend. It can register devices and track events — it cannot send or read. Public by design. |
| Mint a server key sk_live_… | Full power. Server-side only, treated like a password. Shown once. |
2 · Serve the service worker
Put this file at https://yoursite.com/sw.js (root path matters for scope):
importScripts("https://api.notibase.com/sdk/sw.js");
Notibase hosts the worker logic, so fixes reach you without redeploys.
3 · Subscribe the browser
import { Notibase } from "@notibase/web";
const nb = new Notibase({
clientKey: "ck_live_...", // the PUBLIC key
apiUrl: "https://api.notibase.com",
});
// call from a user gesture (a button click), never on page load:
await nb.subscribeWebPush("<YOUR_VAPID_PUBLIC_KEY>");
UX tip: show your own “Enable notifications?” prompt first (a soft prompt), and only
call
subscribeWebPush after the user says yes — browsers punish sites that fire the
native permission dialog on load.4 · Identify the user (recommended)
On your server, sign the user id; in the browser, attach it:
// server (Node):
import { signIdentify } from "@notibase/node";
const signature = signIdentify(process.env.NOTIBASE_IDENTIFY_SECRET, user.id);
// browser:
await nb.identify(user.id, { signature, attributes: { plan: "pro" } });
Generate the identify secret in Setup → Identity verification. Why this matters →
5 · Send
curl -X POST https://api.notibase.com/v1/messages \
-H "authorization: Bearer sk_live_..." \
-H "content-type: application/json" \
-H "idempotency-key: first-send-1" \
-d '{"audience": {"all": true},
"content": {"title": "Hello {{first_name | default: 'there'}} 👋",
"body": "Sent through your own Notibase.",
"url": "https://yoursite.com"}}'
The response includes a message id and a delivery report. Pull the per-device
timeline — with the raw push-service response — any time:
curl https://api.notibase.com/v1/messages/<id>/deliveries \
-H "authorization: Bearer sk_live_..."
Where next
| Node SDK | Typed client, idempotent by default, scheduling. |
| Audience filters | Target by country, attributes, activity — with live counts. |
| iOS & Android | Upload APNs/FCM credentials, register device tokens. |
| AI features | Draft copy, build audiences in English, explain failures. |