# Waitlist and invite codes

> A waitlist with positions and approvals, and hashed invite codes with a use limit, an expiry and an optional organization and role. waitlist_admit() backs a before-user-created hook that only lets approved addresses or valid codes sign up.

- Category: Growth & engagement
- Module: `waitlist`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/waitlist
- Page: https://bettersupabase.com/blocks/waitlist

## Install

```bash
npx better-supabase add waitlist
```

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 waitlist; add installs them too.
    "updated-at": {},
    memberships: {},
    permissions: {},
    // Modes: "managed", "custom". The default is "managed".
    waitlist: { mode: "managed" },
  },
});
```

## Client

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

## Events

- `invite_code.created`
- `invite_code.revoked`
- `organization.member_added`
- `waitlist_entry.approved`
- `waitlist_entry.rejected`

## Related blocks

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

Works with: [invitations](https://bettersupabase.com/blocks/invitations.md), [organizations](https://bettersupabase.com/blocks/organizations.md)

## Recipes

- [Waitlist signup](https://bettersupabase.com/recipes/waitlist-signup.md): An email form that joins the waitlist and shows the position in line.
