# Shared inbox

> Conversations with contacts across the in-app widget and chat channels, on the messaging core: inboxes, members and teams, contacts who are people of the contacts block, messages and internal notes with scanned files, mentions, assignment, bot hand-off, read state, delivery status, stored webhook events, message templates, scheduled replies and reply drafts, including ai drafts staff review. Staff read with inbox.read; contacts read their own conversations without the notes; Realtime pings carry ids only.

- Category: Notifications & messaging
- Module: `inbox`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/inbox
- Page: https://bettersupabase.com/blocks/inbox

## Install

```bash
npx better-supabase add inbox
```

The command also installs `updated-at`, `memberships`, `permissions`, `attachments`, `teams`, `subjects`, `contacts`, `messaging`.

## Configure

Add the block to `better-supabase.config.ts`:

```ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  blocks: {
    // Required by inbox; add installs them too.
    "updated-at": {},
    memberships: {},
    permissions: {},
    attachments: {},
    teams: {},
    subjects: {},
    contacts: {},
    messaging: {},
    // Modes: "managed", "custom". The default is "managed".
    inbox: { mode: "managed" },
  },
});
```

## Client

The React hooks are the registry item `@better-supabase/use-inbox` (`npx shadcn add @better-supabase/use-inbox`). They return data and actions and render no UI. Source: https://github.com/ScaleDockHQ/better-supabase/blob/main/packages/registry/items/hooks/use-inbox.ts

## Events

- `inbox_conversation.assigned`
- `inbox_conversation.opened`
- `inbox_conversation.reopened`
- `inbox_conversation.resolved`
- `inbox_conversation.unsnoozed`
- `inbox_message.received`

## Related blocks

Requires: [memberships](https://bettersupabase.com/blocks/memberships.md), [permissions](https://bettersupabase.com/blocks/permissions.md), [updated-at](https://bettersupabase.com/blocks/updated-at.md), [teams](https://bettersupabase.com/blocks/teams.md), [messaging](https://bettersupabase.com/blocks/messaging.md), [attachments](https://bettersupabase.com/blocks/attachments.md), [contacts](https://bettersupabase.com/blocks/contacts.md)

Works with: [queue](https://bettersupabase.com/blocks/queue.md), [notifications](https://bettersupabase.com/blocks/notifications.md), [reactions](https://bettersupabase.com/blocks/reactions.md), [data-lifecycle](https://bettersupabase.com/blocks/data-lifecycle.md), [automations](https://bettersupabase.com/blocks/automations.md), [tasks](https://bettersupabase.com/blocks/tasks.md), [tags](https://bettersupabase.com/blocks/tags.md)

## Recipes

- [Inbox with threads](https://bettersupabase.com/recipes/inbox-threads.md): A shared inbox queue with search and status, assignee and channel filters in the URL; each row opens its thread beside the list.
