# Collections

> Favorites (a member's ranked stars on any registered record), lists (named, static collections of one subject type owned by a user, a team or the organization) and saved items (a member's records to come back to, with a note and a reminder), with entries hidden unless the caller can read their record.

- Category: Work management
- Module: `collections`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/collections
- Page: https://bettersupabase.com/blocks/collections

## Install

```bash
npx better-supabase add collections
```

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

## Configure

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

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

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

## Client

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

## Events

- `collection.archived`
- `collection.created`
- `collection.entry_added`
- `collection.entry_removed`
- `collection.restored`
- `saved_item.reminded`

## Related blocks

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

Works with: [outbox](https://bettersupabase.com/blocks/outbox.md), [teams](https://bettersupabase.com/blocks/teams.md), [bulk-actions](https://bettersupabase.com/blocks/bulk-actions.md)
