> ## 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

> Neon plugin for Corsair

Use **Neon** through Corsair: one client, typed API calls, optional local DB sync.

Neon exposes project, branch, database, role, compute endpoint, auth, organization, and infrastructure workflows for serverless Postgres. Use Corsair permissions for destructive actions such as deleting projects, dropping branches or databases, revoking API keys, or removing VPC endpoints.

**What you get:**

* 110 typed API operations
* 8 database entities synced for fast `.search()` / `.list()` queries

## Setup

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

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

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

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

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

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

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

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

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

      <Tab title="Multi-Tenant">
        ```bash theme={null}
        pnpm corsair setup --plugin=neon --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}
    neon()
    ```

    Store credentials with `pnpm corsair setup --plugin=neon` (see [Get Credentials](/plugins/neon/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>

## Query synced data

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

## Example API calls

**Read-style (read):** `apiKeys.listApiKeys`

```ts theme={null}
await corsair.neon.api.apiKeys.listApiKeys({});
```

**Write-style (write):** `apiKeys.createApiKey`

```ts theme={null}
await corsair.neon.api.apiKeys.createApiKey({});
```

See the full list on the [API](/plugins/neon/api) page. Use `pnpm corsair list --plugin=neon` 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 [Webhooks](/concepts/webhooks) for routing and payload patterns.

***

## Reference

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