# Scores

> Tenant-editable scoring models: rules (a filter tree over the rules field catalog worth points) and metrics (a number times a weight, or a record's vote score) that write versioned scores with bands to any subject. Lead scoring and health scoring are models.

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

## Install

```bash
npx better-supabase add scores
```

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

## Configure

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

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

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

## Client

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

## Events

- `score.changed`
- `score_model.deleted`
- `score_model.saved`

## Related blocks

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

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