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

> Business data from Enigma's small business graph - match brands by name, website, phone or a natural-language prompt, read brand details with paged operating locations and legal entities, match operating locations, and look up legal entities with their registered entities.

Use **Enigma** through Corsair: one client, typed API calls.

Create a key in the Enigma Console under API Keys. Every call goes to one GraphQL endpoint, `https://api.enigma.com/graphql`. Things to know before you query:

* **Read-only.** All four operations are GraphQL queries; none of them writes or deletes anything at Enigma.
* **Matching, not search listings.** `brands.match` and `locations.match` send the terms to Enigma's resolver and return the single best match, or `null` when nothing clears the confidence bar. Narrow with `address` and raise `matchThreshold` (0.0 to 1.0) to reject weak matches.
* **`prompt`.** `brands.match` accepts a natural-language business description instead of name, website or phone, but it cannot be combined with any of them or with `address`.
* **Paging.** `brands.get` pages the brand's operating locations with `locationsFirst` and the `endCursor` from the previous page's `pageInfo`. `legalEntitiesFirst` sizes the legal entities list, which is not paged.
* **Card revenue costs credits.** `cardRevenue12m` is the projected 12-month card revenue Enigma reports for the brand or location, in dollars. Enigma bills it per value returned (25 credits each on its price list as of November 2026), so `brands.get` with the default 10 locations can use about 275 credits in one call. Set `locationsFirst` lower when you only need the brand's details. `brands.match` returns one value.
* **Rate limits.** Limits are per plan, daily and monthly. Over the limit the API answers 429 with a `Retry-After` header; the plugin retries up to three times, honoring that header. A 402 means the account is out of credits and is not retried.
* **Webhooks.** Enigma does not send webhooks to this plugin.

**What you get:**

* 4 typed API operations

## Setup

**1. Install**

```bash npm theme={null}
npm install corsair @corsair-dev/enigma better-sqlite3
```

```bash yarn theme={null}
yarn add corsair @corsair-dev/enigma better-sqlite3
```

```bash pnpm theme={null}
pnpm install corsair @corsair-dev/enigma better-sqlite3
```

```bash bun theme={null}
bun add corsair @corsair-dev/enigma better-sqlite3
```

**2. Add the plugin**

```ts corsair.ts theme={null}
import Database from 'better-sqlite3';
import { createCorsair } from 'corsair';
import { enigma } from '@corsair-dev/enigma';

export const corsair = createCorsair({
	plugins: [
		enigma(),
	],
	database: new Database('corsair.db'),
	kek: process.env.CORSAIR_KEK!,
	hub: {
		projectApiKey: process.env.CORSAIR_API_KEY!,
		signingSecret: process.env.CORSAIR_SIGNING_SECRET!,
	},
});
```

Multi-tenancy is the default — scope calls with `corsair.withTenant(id)`. See [Quick start](https://docs.corsair.dev/quick-start.md) for KEK + Hub keys, and [Multi-tenancy](https://docs.corsair.dev/concepts/multi-tenancy.md) for account isolation.

**3. Choose authentication**

> [tab] API Key (Recommended)
>
> No setup required here. When a tenant calls the API before a key is saved, the call throws an `AuthMissingError`, which may carry a `connectUrl` the tenant follows to save their Enigma API key.
>
> ```ts theme={null}
> enigma()
> ```
>
> More: [API Key](https://docs.corsair.dev/concepts/api-key)

**4. Connect a tenant**

Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see [Connect / OAuth](https://docs.corsair.dev/management/connect).

```ts theme={null}
const { connectUrl } = await corsair.manage.connect.createLink({
	plugin: 'enigma',
	tenantId: 'acme',
});
// redirect the user's browser to connectUrl
```

## Example API calls

**Match a brand by name and state**

```ts theme={null}
const tenant = corsair.withTenant('acme');
await tenant.enigma.api.brands.match({
	name: 'Starbucks',
	address: { state: 'WA' },
	matchThreshold: 0.5,
});
```

**Read a brand detail by ID**

```ts theme={null}
const tenant = corsair.withTenant('acme');
await tenant.enigma.api.brands.get({ id: '5f1147ed-4d0e-4f36-a1d2-c2b3f2b1a9c4', locationsFirst: 10 });
```

See the full list on the [API](https://docs.corsair.dev/plugins/enigma/api.md) page.

## What's next

> [card] [API reference](https://docs.corsair.dev/plugins/enigma/api.md)
>
> Every `enigma.api.*` operation with input and output types.

> [card] [Connect / OAuth](https://docs.corsair.dev/management/connect)
>
> createLink, Hub delivery, and tenant connect flows.

> [card] [Use with agents](https://docs.corsair.dev/mcp-adapters/mcp-adapters)
>
> Expose this plugin's operations as MCP tools.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.