in_app channel becomes an item in the recipient’s inbox. This guide shows how to display that inbox, mark items as read, and stream new notifications to your UI in real time.
The inbox lives in the archie_notifications_in_app table, exposed through the auto-generated GraphQL operations on your project endpoint (https://archie-core.services.archie.com/graphql) with the usual X-Project-Id, X-Environment, and Authorization headers.
What an inbox item contains
Show a user’s inbox
Fetch the most recent, non-expired items for the signed-in user:Soft-deleted records. List queries exclude soft-deleted rows by default, so a dismissed or removed inbox item won’t reappear. To include records that have been soft-deleted, pass the
withDeleted: true argument on the list query (e.g., archieNotificationsInApp(withDeleted: true) { items { id } }). Omit it — or set it to false — to return only active rows.Count unread
Use a filter to show an unread badge:Mark as read
Receive notifications in real time
To make new notifications appear instantly — without polling — use Archie’s subscriptions. There are two steps: register a subscription configuration, then connect over a WebSocket to receive events.1. Register the subscription
Use thesystem { createSubscription } mutation to declare which table and operations to watch. For an inbox, watch the in-app table for new rows (CREATE):
Inside a subscription’s
fields list, use the raw column names in snake_case (e.g., receiver_id, notification_key, is_read) — these are the database column names, not the camelCase API fields.2. Connect and listen
Open a WebSocket to the project’s subscription endpoint and you’ll receive an event each time a matching row is created:fields you registered. Filter client-side by receiver_id so each user only reacts to their own items, then update the inbox UI (prepend the item, bump the unread badge).
Putting it together
A complete in-app experience usually looks like this:- On load, query the inbox and the unread count.
- Register (once) the
in_app_inboxsubscription and connect the WebSocket. - When an event arrives, prepend the new item and increment the badge.
- When the user opens an item, mark it read and decrement the badge.