# Lead scoring

> Scores people, and optionally companies, under a tenant-editable score model. Each record's columns, enrichment status, segments and mail opens, clicks and replies feed the model, and the record is scored again when any of them change.

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

## Install

```bash
npx better-supabase add lead-scoring
```

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

## Configure

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

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

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

## Client

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

## Related blocks

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

Works with: [enrichment](https://bettersupabase.com/blocks/enrichment.md), [segments](https://bettersupabase.com/blocks/segments.md), [mail-sync](https://bettersupabase.com/blocks/mail-sync.md)
