Browser push for your app, without running a push server.
Push is already part of SaaSOSProvider, the wrapper your app has anyway, so users turn on notifications from your own button or the notifications settings screen. BuildBase generates the VAPID keys on the first subscribe, stores every device, and delivers from a queue, so sending is one call from your backend.
Your app is an organization in BuildBase. Your users sign in and work inside workspaces - one per team or customer.
You set up
In the console and the SDK
- A 'turn on notifications' button in your app
- One call from your server when something happens
- Campaigns to a list, written in the console
Your users get
Inside their workspace
- Browser notifications, even when your app is closed
- A settings screen to choose which notifications they want
- Notifications on each device they turn them on for
Push without the plumbing
Keys, device subscriptions, delivery and expired-device cleanup are handled. You add a button and a send call.
No Keys to Manage
The keys browsers need are created for you the first time someone subscribes. There is no push service to set up.
One Button to Subscribe
Add a button that asks for permission and subscribes the device. Signing a device out stops its notifications.
Push and Email in One Call
Send a notification to one user or a whole workspace, by push and email, and each user's preferences are respected.
Rich Notifications
Title, message, image, a link to open and up to two buttons. Replace an earlier notification instead of stacking them.
Campaigns From the Console
Write a notification, pick a list and send it, then see how many devices it reached.
Safe Links
Links in notifications are checked, and a link found to be harmful stops working even after it was sent.
A button in the browser, one call on the server
subscribe() asks for permission if it needs to. notification.send() reports which channels actually went out.
'use client';
import { usePushNotifications } from '@buildbase/sdk/react';
// Inside SaaSOSProvider, which mounts the push provider
export function NotificationToggle() {
const {
isSupported,
permission,
isSubscribed,
loading,
subscribe,
unsubscribe,
} = usePushNotifications();
if (!isSupported) return null;
if (permission === 'denied') {
return <p>Notifications are blocked in this browser.</p>;
}
return (
<button disabled={loading} onClick={isSubscribed ? unsubscribe : subscribe}>
{isSubscribed ? 'Turn off notifications' : 'Turn on notifications'}
</button>
);
}import BuildBase from '@buildbase/sdk';
const bb = BuildBase({ serverUrl, orgId, getSessionId });
const result = await bb.notification.send(workspaceId, 'comment_added', userId, {
title: 'New comment',
message: 'Alice replied on "Q3 roadmap"',
url: '/projects/42#comment-8',
tag: 'project-42-comments',
actions: [{ action: 'open', title: 'Open' }],
channels: { push: true },
});
if (!result.channels.push) {
// blocked by a gate, or the user turned push off for this event
}An inbox for everything you send
What a user was sent by push, email or both stays in an inbox they can come back to. Needs @buildbase/sdk 0.0.71 or later.
A bell with the unread count
Drop in NotificationBell and it shows how many are unread and opens the inbox in a panel. New items appear live, and it checks again every minute in case the live connection drops.
Every notification, once
Built-in events, your own sends, workflow messages and push campaigns each show up as one item, even when one went out by both email and push. Sign-in codes never appear.
Read is read everywhere
Read an item in the bell and the full page updates at once. Clicking the link in a push or an email marks it read. An email security scanner loading the message does not.
Members choose how
For events you let users control, each member picks email, push or neither, and a workspace admin can set a default and make it required. The item still lands in the inbox.
Clicks checked first
Links in notifications go through BuildBase first, which counts the click and checks where it leads. If a link turns out to be harmful after it was sent, it stops working on every device.
A delivery log for your team
Every member's notifications, with what happened on each channel, in the console and on each workspace and user page.
import { NotificationBell, NotificationInbox } from '@buildbase/sdk/react';
export function Header() {
return (
<header>
<Logo />
<NotificationBell />
</header>
);
}
// app/notifications/page.tsx
export function NotificationsPage() {
return <NotificationInbox workspaceId="current" />;
}Works well with
Other modules for messaging.
Read more in the docs
Setup guides and reference for Push Notifications.
Overview
Web push with VAPID keys generated for you, device subscriptions and campaign delivery counts.
Notifications
Send email and push notifications to a user or a whole workspace through one gated call.
Notification inbox
A bell and an inbox that keep every notification a user was sent, read or not.
Server SDK
Node.js SDK for backend operations - usage recording, credit consumption, notifications, and more.
Settings screens
Pre-built settings for profile, members, billing, usage, features, and more.
Triggers and actions
The full catalog of workflow triggers, actions, and conditions with their inputs and outputs.
Frequently Asked Questions
What people ask about Push Notifications.
Do my users see this?
Yes. They get browser notifications on the devices where they turned them on, and choose which ones they want in their settings.
Does it work in mobile apps?
It is web push only - notifications in the browser, including on phones (on iPhone, once your web app is added to the home screen). There is no native iOS or Android app push.
Do I need to set up keys?
No. The keys browsers need are created for you the first time someone subscribes.
Can I see open or click rates?
No. Campaigns show how many devices each one was delivered to, failed on or found expired.
Do notifications stay somewhere after they are dismissed?
Yes. Every notification a user is sent, by push, email or both, is kept in an inbox. The NotificationBell and NotificationInbox components show it in your app, with @buildbase/sdk 0.0.71 or later.
Send your first push notification
Add a turn-on button, put the service worker (the small script browsers run for push) on your site, and call bb.notification.send() from your backend. The keys are created on the first subscribe.