# epilot SDK

@epilot/sdk is the official TypeScript SDK for epilot: one package with 30+ fully typed API clients. Install it, get started and import only the clients you need.

[[GitHub](https://github.com/epilot-dev/sdk-js)] [[npm](https://www.npmjs.com/package/@epilot/sdk)]

> **Tip: Every epilot API ships with a typed TypeScript client. Full types and IntelliSense out of the box.**

> **Info: **Not using TypeScript?** All epilot APIs are published with standard [OpenAPI definitions](/api). You can generate a typed client in any language using tools like [openapi-generator](https://openapi-generator.tech/), [Speakeasy](https://speakeasyapi.dev/), or [Kiota](https://learn.microsoft.com/en-us/openapi/kiota/).**

## Install

  

```bash
npm i @epilot/sdk axios openapi-client-axios
```

  
  

```bash
yarn add @epilot/sdk axios openapi-client-axios
```

  
  

```bash
pnpm add @epilot/sdk axios openapi-client-axios
```

  

`@epilot/sdk` is the official TypeScript SDK for the epilot platform. One package, 30+ API clients, full type safety.

- **Typed operations**: every endpoint has typed params and responses, generated from OpenAPI specs
- **Tree-shakeable**: import only the APIs you use; unused clients never touch your bundle
- **Lazy-loaded**: API specs are loaded on first use, not at import time
- **Batteries included**: automatic retries, large response handling, and auth management out of the box
- **Just an axios client**: every client is a standard [axios](https://axios-http.com/docs/intro) instance with typed methods from [openapi-client-axios](https://openapistack.co/docs/openapi-client-axios/intro/). Interceptors, defaults, and all other axios features work as expected.

## Quick start

```ts
import { epilot } from '@epilot/sdk'

// Authorize once, all clients pick up the token
epilot.authorize(() => '<my-bearer-token>')

// Call any API with full type safety and auto-complete
const { data: entity } = await epilot.entity.createEntity(
  { slug: 'contact' },
  { first_name: 'John', last_name: 'Doe' },
)

const { data: file } = await epilot.file.getFile({ id: 'file-123' })

const { data: executions } = await epilot.workflow.getExecutions()
```

Each operation is forwarded to a lazy singleton. The spec is loaded and the client initialized on first use, then cached.

## Only import what you need

For smaller bundles, use tree-shakeable subpath imports:

```ts
import { entity, authorize } from '@epilot/sdk/entity'

authorize(entity, () => '<my-bearer-token>')
const { data } = await entity.getEntity({ slug: 'contact', id: '123' })
```

See [Client Usage](client-usage.md) for all import patterns.

## Available APIs

| API | Import | Reference |
| --- | ------ | --------- |
| `epilot.accessToken` | `@epilot/sdk/access-token` | [SDK](clients/access-token.md) · [API](/api/access-token) |
| `epilot.addressSuggestions` | `@epilot/sdk/address-suggestions` | [SDK](clients/address-suggestions.md) · [API](/api/address-suggestions) |
| `epilot.app` | `@epilot/sdk/app` | [SDK](clients/app.md) · [API](/api/app) |
| `epilot.auditLogs` | `@epilot/sdk/audit-logs` | [SDK](clients/audit-logs.md) · [API](/api/audit-logs) |
| `epilot.automation` | `@epilot/sdk/automation` | [SDK](clients/automation.md) · [API](/api/automation) |
| `epilot.billing` | `@epilot/sdk/billing` | [SDK](clients/billing.md) · [API](/api/billing) |
| `epilot.blueprintManifest` | `@epilot/sdk/blueprint-manifest` | [SDK](clients/blueprint-manifest.md) · [API](/api/blueprints) |
| `epilot.consent` | `@epilot/sdk/consent` | [SDK](clients/consent.md) · [API](/api/consent) |
| `epilot.customerPortal` | `@epilot/sdk/customer-portal` | [SDK](clients/customer-portal.md) · [API](/api/customer-portal) |
| `epilot.dashboard` | `@epilot/sdk/dashboard` | [SDK](clients/dashboard.md) · [API](/api/dashboard) |
| `epilot.design` | `@epilot/sdk/design` | [SDK](clients/design.md) · [API](/api/design) |
| `epilot.document` | `@epilot/sdk/document` | [SDK](clients/document.md) · [API](/api/document) |
| `epilot.emailSettings` | `@epilot/sdk/email-settings` | [SDK](clients/email-settings.md) · [API](/api/email-settings) |
| `epilot.emailTemplate` | `@epilot/sdk/email-template` | [SDK](clients/email-template.md) · [API](/api/email-template) |
| `epilot.entity` | `@epilot/sdk/entity` | [SDK](clients/entity.md) · [API](/api/entity) |
| `epilot.entityMapping` | `@epilot/sdk/entity-mapping` | [SDK](clients/entity-mapping.md) · [API](/api/entity-mapping) |
| `epilot.environments` | `@epilot/sdk/environments` | [SDK](clients/environments.md) · [API](/api/environments) |
| `epilot.erpIntegration` | `@epilot/sdk/erp-integration` | [SDK](clients/erp-integration.md) · [API](/api/erp-integration) |
| `epilot.eventCatalog` | `@epilot/sdk/event-catalog` | [SDK](clients/event-catalog.md) · [API](/api/event-catalog) |
| `epilot.file` | `@epilot/sdk/file` | [SDK](clients/file.md) · [API](/api/file) |
| `epilot.journey` | `@epilot/sdk/journey` | [SDK](clients/journey.md) · [API](/api/journey) |
| `epilot.kanban` | `@epilot/sdk/kanban` | [SDK](clients/kanban.md) · [API](/api/kanban) |
| `epilot.message` | `@epilot/sdk/message` | [SDK](clients/message.md) · [API](/api/message) |
| `epilot.metering` | `@epilot/sdk/metering` | [SDK](clients/metering.md) · [API](/api/metering) |
| `epilot.notes` | `@epilot/sdk/notes` | [SDK](clients/notes.md) · [API](/api/notes) |
| `epilot.notification` | `@epilot/sdk/notification` | [SDK](clients/notification.md) · [API](/api/notification) |
| `epilot.organization` | `@epilot/sdk/organization` | [SDK](clients/organization.md) · [API](/api/organization) |
| `epilot.partnerDirectory` | `@epilot/sdk/partner-directory` | [SDK](clients/partner-directory.md) · [API](/api/partner) |
| `epilot.permissions` | `@epilot/sdk/permissions` | [SDK](clients/permissions.md) · [API](/api/permissions) |
| `epilot.pricing` | `@epilot/sdk/pricing` | [SDK](clients/pricing.md) · [API](/api/pricing) |
| `epilot.purpose` | `@epilot/sdk/purpose` | [SDK](clients/purpose.md) · [API](/api/purpose) |
| `epilot.submission` | `@epilot/sdk/submission` | [SDK](clients/submission.md) · [API](/api/submission) |
| `epilot.targeting` | `@epilot/sdk/targeting` | [SDK](clients/targeting.md) · [API](/api/targeting) |
| `epilot.templateVariables` | `@epilot/sdk/template-variables` | [SDK](clients/template-variables.md) · [API](/api/template-variables) |
| `epilot.user` | `@epilot/sdk/user` | [SDK](clients/user.md) · [API](/api/user) |
| `epilot.validationRules` | `@epilot/sdk/validation-rules` | [SDK](clients/validation-rules.md) · [API](/api/validation-rules) |
| `epilot.webhooks` | `@epilot/sdk/webhooks` | [SDK](clients/webhooks.md) · [API](/api/webhooks) |
| `epilot.workflow` | `@epilot/sdk/workflow` | [SDK](clients/workflow.md) · [API](/api/workflow-execution) |
| `epilot.workflowDefinition` | `@epilot/sdk/workflow-definition` | [SDK](clients/workflow-definition.md) · [API](/api/workflow-definition) |