A streaming alert overlay turns shop activity into on-stream engagement. A card animates in when an order or tip lands, the chat sees it, the creator reacts to it live. This guide walks through the architecture for building one against Fourthwall webhooks — modeled on Fourthwall’s first-party Alerts app. The overlay itself is a plain webpage your creators drop into OBS, Streamlabs, or any streaming tool that supports HTML browser sources. Webhooks land on your server, and you need to push them out to the OBS browser page in real time. This guide will also show you how to set up an embedded settings page for your app. This way, the creator can manage their overlay settings without leaving Fourthwall.Documentation Index
Fetch the complete documentation index at: https://docs.fourthwall.com/llms.txt
Use this file to discover all available pages before exploring further.
A complete, runnable implementation of this guide — install, embedded settings, webhook receiver, SSE transport, and overlay — lives in the streaming-alerts example on GitHub.
Architecture
Five moving parts:- Install + webhook registration. On install, your app runs the OAuth flow once, then subscribes to
ORDER_PLACEDandDONATIONfor that shop, scoped to your webhook receiver URL. - Embedded settings page. An iframe Fourthwall renders inside the dashboard, identified by a signed handoff. This is the creator’s control surface: overlay URL, test alert, and privacy/enable toggles.
- Webhook receiver. A signed HTTP endpoint that validates the payload, looks up the owning shop, and hands the event to the fan-out layer.
- Push transport. A long-lived connection from the browser source to your server. The path-of-least-resistance is Server-Sent Events (SSE) — one direction, automatic reconnect, no protocol upgrade.
- Overlay page. A static HTML/JS page identified by a per-shop slug. It subscribes to the stream, queues incoming events, and animates them one at a time.
1. Install the App
Use the standard App OAuth flow so the creator can authorize your app against their shop with one click at install. On callback, exchange the code for an access token and resolve the shop withGET /shops/current. You need the token just long enough to register the webhooks (next step) — you don’t have to store it. Afterward, the embedded settings handoff re-identifies the shop on every request by signature, so persist only what you key off per shop (the webhook secret, the toggles).
2. Register the Webhooks
Immediately after connecting a shop, register a single webhook subscribed to the alert-worthy events. Subscribing once per shop — instead of per overlay session — keeps the configuration stable across reconnects.secret you’ll use to verify signatures on every incoming event.
3. Receive and Fan Out
Your webhook receiver:- Verifies the
X-Fourthwall-Hmac-Apps-SHA256header against the body using the storedsecret. - Resolves the shop from the webhook payload (
shopIdis included). - Pushes the event onto the in-memory channel (or pub/sub topic) for that
shopId. - Returns
200 OKimmediately — alert overlays are fire-and-forget; if no overlay is listening, the event is silently dropped.
4. Push to the Overlay
The simplest transport that works in every browser source is Server-Sent Events. One endpoint per shop, the browser opens anEventSource, your server holds the connection open and writes a line of JSON for each event.
5. Build the Overlay Page
The creator copies a URL likehttps://your-app.com/overlay/{shopId} and pastes it into OBS as a browser source. The page opens an EventSource, queues events, and animates them serially so two cards never overlap.
- Reconnection.
EventSourceretries automatically, but back off exponentially on the server side (e.g.1s × 2^n) so a flapping creator doesn’t hammer you. - Identifying the shop. Put the
shopIdin the URL path, not in a query parameter — browser sources sometimes strip query strings on reload. - No replay. Don’t try to backfill missed events when the overlay reconnects. The creator wasn’t on screen to react to them anyway; replaying stale alerts feels worse than dropping them.
- Idempotency. Webhooks can be retried. Dedupe on the event ID before fanning out so the overlay doesn’t show the same alert twice.
- Sound. Browsers gate audio behind a user gesture, but OBS auto-grants it for browser sources. Test in OBS, not in a regular browser tab.
6. The Settings Page
The creator manages everything from an embedded settings page — the iframe Fourthwall renders inside the dashboard. Set its URL under Settings URL on your Platform App. Fourthwall loads it with a signed handoff:hmac before trusting the request — it’s what authenticates the shop, on the page load and on every API call the page makes back to you. It’s HMAC-SHA512, Base64-encoded (distinct from the SHA256 hex used for webhook delivery) over timestamp={ts}&shop_id={id}&app_id={app_id}, signed with the HMAC secret from your Platform App’s basic information.
Privacy
Supporters can be sensitive about having their real name on a livestream. Give the creator a toggle — on the settings page above — to replace the supporter’s name with a generic label (“Anonymous”, “A supporter”) before the alert is pushed to the overlay. Apply the transformation server-side so the overlay never sees the real name.Reference
Runnable Example
The full implementation of this guide
App OAuth
Connect a shop with one click
Embedded Settings
Render your settings page in the dashboard
Manage Webhooks via API
Register subscriptions programmatically
Verify Signatures
Validate the HMAC header
ORDER_PLACED event
Purchase webhook payload
DONATION event
Tip webhook payload
Retry Policies
What happens when your receiver is down