# Moderation

> Reports on any subject, a review queue, decisions (approve, hide, remove, restore, ban) with a log, user bans and an automatic hide threshold. Reviews moderate through it, and it hides and removes messages, comments included.

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

## Install

```bash
npx better-supabase add moderation
```

The command also installs `updated-at`, `tenant`, `access`.

## Configure

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

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

export default defineConfig({
  blocks: {
    // Required by moderation; add installs them too.
    "updated-at": {},
    tenant: {},
    access: {},
    // Modes: "managed", "custom". The default is "managed".
    moderation: { mode: "managed" },
  },
});
```

## Client

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

## Events

- `moderation_ban.created`
- `moderation_ban.lifted`
- `moderation_item.decided`
- `moderation_report.created`

## Related blocks

Requires: [tenant](https://bettersupabase.com/blocks/tenant.md), [access](https://bettersupabase.com/blocks/access.md)

Works with: [messaging](https://bettersupabase.com/blocks/messaging.md), [outbox](https://bettersupabase.com/blocks/outbox.md), [audit](https://bettersupabase.com/blocks/audit.md)
