# Durable streams

> Ordered text chunks a writer appends and any reader resumes from an index: idempotent batches, a cancel flag the writer reads on its next append, owner reads through RLS, a payload-free Realtime ping on a private topic per stream, and a purge for expired streams.

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

## Install

```bash
npx better-supabase add streams
```

## 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".
    streams: { mode: "managed" },
  },
});
```

## Client

The block is SQL only: call its functions from your policies, RPCs and the other modules.
