# Parties

> Companies and people an organization works with: lifecycle stages, owners, who works where with a role and a primary contact, domain and email dedupe, merges and keyset-paged search.

- Category: CRM & sales
- Module: `contacts`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/contacts
- Page: https://bettersupabase.com/blocks/contacts

## Install

```bash
npx better-supabase add contacts
```

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

## Client

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

## Events

- `company.archived`
- `company.created`
- `company.merged`
- `company.person_linked`
- `company.person_unlinked`
- `company.updated`
- `person.archived`
- `person.created`
- `person.merged`
- `person.updated`

## Related blocks

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

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

## Recipes

- [Contact detail](https://bettersupabase.com/recipes/contact-detail.md): A person or company with its details, related contacts and the latest activity.
