# Outbox

> Events written in the same transaction as the change, read by named consumers with their own cursor and lease, kept for history and relayed as CloudEvents.

- Category: Automation
- Module: `outbox`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/outbox
- Page: https://bettersupabase.com/blocks/outbox

## Install

```bash
npx better-supabase add outbox
```

## Configure

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

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

export default defineConfig({
  blocks: {
    // Modes: "managed", "custom". The default is "managed".
    outbox: { mode: "managed" },
  },
});
```

## Client

The block has no React entry yet. Its server-side TypeScript is in `better-supabase/blocks/outbox`.

## Related blocks

Works with: [data-lifecycle](https://bettersupabase.com/blocks/data-lifecycle.md)
