Skip to main content
The IN_APP channel stores notification payloads in the database instead of dispatching to external carriers. This gives you a fast, reliable mechanism for populating user-facing activity feeds.

Reading and Marking Feeds

Applications read from and update the state of the inapp_notifications table:
  • Polling: Query unread items on a periodic loop (e.g. every 15s) from your web components.
  • Server-Sent Events (SSE): Establish persistent socket-like streaming channels to display instant feed increments without polling.

Database Schema Structure

The underlying table layout is defined in schema.prisma:

Building a Notification UI

For a premium user experience, follow these design guidelines in your client-side implementation:
  1. Badges: Use a badge (e.g. rose-600 background) displaying the unread notification count on top of a Bell icon.
  2. Smooth Dismissal: Trigger a fast optimistic UI update, hiding the dismissed element instantly while launching the mark-as-read POST call in the background.
  3. Empty States: Render a clean illustration and description (e.g., “All caught up!”) when there are no unread notifications.

Developer Implementation

1. Triggering an In-App Notification

To trigger an in-app notification for a user, call POST /api/v1/notify specifying IN_APP as the channel:

2. Fetching Notifications (Backend Proxy)

Always fetch notifications through your own backend proxy to avoid exposing your secret API key to the browser:

3. Marking Notifications as Read

To mark notifications as read when the user views their feed, invoke the read endpoint: