Skip to main content
Every notification delivered through the 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 the system { createSubscription } mutation to declare which table and operations to watch. For an inbox, watch the in-app table for new rows (CREATE):
Variables
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:
When a new notification is delivered to a user, your client receives the row described by the 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).
Watch ["CREATE", "UPDATE"] if you also want live updates when an item is marked as read on another device.

Putting it together

A complete in-app experience usually looks like this:
  1. On load, query the inbox and the unread count.
  2. Register (once) the in_app_inbox subscription and connect the WebSocket.
  3. When an event arrives, prepend the new item and increment the badge.
  4. When the user opens an item, mark it read and decrement the badge.
For email and other channels, no inbox handling is needed — Archie delivers those directly through the configured integration.