# Teams

> Tenant teams and their members. Inbox assignment uses these rows instead of its own team tables.

- Category: Tenancy & accounts
- Module: `teams`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/teams
- Page: https://bettersupabase.com/blocks/teams

## Install

```bash
npx better-supabase add teams
```

The command also installs `updated-at`, `memberships`, `permissions`.

## Configure

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

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

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

## Client

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

## Events

- `team.archived`
- `team.created`
- `team.purged`
- `team.updated`
- `team_member.added`
- `team_member.deleted`

## Related blocks

Requires: [memberships](https://bettersupabase.com/blocks/memberships.md), [permissions](https://bettersupabase.com/blocks/permissions.md)

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

## Recipes

- [Team picker](https://bettersupabase.com/recipes/team-picker.md): A select of the caller's teams in the active organization, to scope a page or assign work.
