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

# Packages

> Choose the published Hookfish package and import path for each integration layer.

Hookfish separates the broker API, storage adapters, provider contracts,
provider implementations, React integration, and CLI into published packages.

| Package               | Use it for                                                                 |
| --------------------- | -------------------------------------------------------------------------- |
| `hookfish`            | CLI, scaffolding, packaged dashboard, and MCP inspector                    |
| `@hookfish/api`       | `HookfishServer`, config types, events, database contract, and route types |
| `@hookfish/sdk`       | Generated, end-to-end typed `Hookfish` client for trusted application code |
| `@hookfish/database`  | Shared database types and migration helper                                 |
| `@hookfish/providers` | GitHub, Linear, Notion, and MCP factories                                  |
| `@hookfish/provider`  | Custom provider and registry contracts                                     |
| `@hookfish/hooks`     | Typed client and React hooks for the optional browser facade               |
| `@hookfish/backend`   | Lower-level raw API and browser-facade composition                         |

## Database import paths

```ts theme={null}
import { migrateDatabase } from '@hookfish/database'
import { pglite } from '@hookfish/database/pglite'
import { postgres } from '@hookfish/database/postgres'
import {
  durableObjects,
  HookfishDurableObject,
} from '@hookfish/database/durable-object'
```

The Durable Objects exports are experimental. Use the PostgreSQL adapter with
Hyperdrive for production Workers deployments.

## API import paths

```ts theme={null}
import { HookfishServer, defineHookfishConfig } from '@hookfish/api'
import { createHookfishBackend } from '@hookfish/api/client'
import {
  defineDatabase,
  migrateDatabase,
} from '@hookfish/api/database'
```

For trusted application code, construct `Hookfish` from `@hookfish/sdk`.
Pass `organization` once to select organization-prefixed operations for every
supported resource:

```ts theme={null}
import { Hookfish } from '@hookfish/sdk'

const hookfish = new Hookfish({
  apiKey: process.env.HOOKFISH_API_KEY,
  baseUrl: 'https://broker.example.com/api',
  organization: 'acme',
})

const token = await hookfish.oauth.getToken('billing/github')
```

Use `@hookfish/api` for the broker runtime and lower-level composition. Import
the migration helper from `@hookfish/database`.

## Individual provider packages

`@hookfish/providers` re-exports all built-in factories. Install an individual
package such as `@hookfish/provider-github` or `@hookfish/provider-mcp` when you
want to keep the dependency surface narrow.

<Note>
  Import `@hookfish/backend` only when composing a raw Hookfish-compatible API
  handler yourself. `HookfishServer.init(...).fetch` already applies that layer.
</Note>
