Skip to main content
This section documents the B Brands notification platform — how any business action notifies a user (push, in-app, SMS, live activity) by enqueueing a message that a central consumer dispatches to OneSignal.

What this is

Any business action that needs to notify a user (failed charge, signed contract, campaign) enqueues a notification instead of calling OneSignal directly. A single Vercel queue (notification) feeds a central consumer that dispatches each message to the handler of the corresponding channel.

No lost notifications

Retries with backoff, dead-letter queue and replay inherited from the shared queue_event infrastructure absorb spikes and transient outages.

Idempotent

Each message carries a queue_event_id; a duplicate redelivery is a no-op.

Preference gating

Per-user opt-out is applied before enqueueing, without touching producers.

Single entry point

Producers only call notificationDispatcher; the channel plumbing is hidden behind it.

Channels

How the signal flows

Where to go next

Architecture

The dispatcher, the unified consumer, handlers and the queue payload.

Channels & Targeting

Channel semantics, categories and how users are targeted.

Preferences & Inbox

The opt-out matrix and the user-facing notification inbox.

Operations

Environment variables, DLQ/replay runbook and health.