> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Tally plugin for Corsair

Use **Tally** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below.

**What you get:**

* 26 typed API operations
* 3 database entities synced for fast `.search()` / `.list()` queries
* 1 incoming webhook event types

## Setup

<Steps>
  <Step title="Install">
    ```bash theme={null}
    pnpm install @corsair-dev/tally
    ```
  </Step>

  <Step title="Add the plugin">
    <Tabs>
      <Tab title="Solo">
        ```ts corsair.ts theme={null}
        import { createCorsair } from 'corsair';
        import { tally } from '@corsair-dev/tally';

        export const corsair = createCorsair({
        	// ... other config options,
        	multiTenancy: false,
            plugins: [tally()],
        });
        ```
      </Tab>

      <Tab title="Multi-Tenant">
        ```ts corsair.ts theme={null}
        import { createCorsair } from 'corsair';
        import { tally } from '@corsair-dev/tally';

        export const corsair = createCorsair({
        	// ... other config options,
            multiTenancy: true,
            plugins: [tally()],
        });
        ```

        See [Multi-tenancy](/concepts/multi-tenancy) for account isolation.
      </Tab>
    </Tabs>
  </Step>

  <Step title="Get credentials">
    Follow [Get Credentials](/plugins/tally/get-credentials) if you need help getting keys.
  </Step>

  <Step title="Store credentials">
    <Tabs>
      <Tab title="Solo">
        ```bash theme={null}
        pnpm corsair setup --plugin=tally
        ```

        Use the key names documented in [Get Credentials](/plugins/tally/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields).
      </Tab>

      <Tab title="Multi-Tenant">
        ```bash theme={null}
        pnpm corsair setup --plugin=tally --tenant=<tenantId>
        ```

        Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy).
      </Tab>
    </Tabs>
  </Step>
</Steps>

## Authentication

Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call.

<Tabs>
  <Tab title="API Key (Default)">
    ```ts corsair.ts theme={null}
    tally()
    ```

    Store credentials with `pnpm corsair setup --plugin=tally` (see [Get Credentials](/plugins/tally/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant.

    More: [API Key](/concepts/api-key)
  </Tab>
</Tabs>

## Webhooks

This plugin registers **1** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic.

See [Webhooks](/plugins/tally/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing.

## Query synced data

Synced entities support `corsair.tally.db.<entity>.search()` and `.list()`. See [Database](/plugins/tally/database) for filters and operators.

## Example API calls

**Read-style (read):** `forms.get`

```ts theme={null}
await corsair.tally.api.forms.get({});
```

**Write-style (write):** `forms.create`

```ts theme={null}
await corsair.tally.api.forms.create({});
```

See the full list on the [API](/plugins/tally/api) page. Use `pnpm corsair list --plugin=tally` and `pnpm corsair schema <path>` locally to inspect schemas.

***

## Hooks

Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/tally/webhooks) page for payload types.

***

## Reference

| Topic       | Link                                              |
| ----------- | ------------------------------------------------- |
| API         | [API](/plugins/tally/api)                         |
| Database    | [Database](/plugins/tally/database)               |
| Webhooks    | [Webhooks](/plugins/tally/webhooks)               |
| Credentials | [Get credentials](/plugins/tally/get-credentials) |
