Developer Search

Search developer docs, public resources, and endpoint references.

Get Started
TypeScript SDK

Use the generated client instead of hand-writing fetch calls.

The Asteri public SDK is generated from the same OpenAPI contract that powers the preview docs and reference index. It gives developers typed requests, typed responses, and the same auth headers every time.

Package details

Package name:@asteri/public-api-sdk

Generated from/api/public/v1/openapi.jsonand currently lives as a workspace package.

Install

Use the normal package name externally. Inside this monorepo, prefer the workspace install form.

External package install
pnpm add @asteri/public-api-sdk
Workspace install
pnpm --filter web add @asteri/public-api-sdk@workspace:*
Usage

The generated client takes care ofx-organization-idand eitherx-api-keyor bearer auth for every request.

import { AsteriPublicApiClient } from '@asteri/public-api-sdk';

const client = new AsteriPublicApiClient({
  baseUrl: 'http://localhost:3000',
  organizationId: process.env.ASTERI_ORG_ID!,
  apiKey: process.env.ASTERI_API_KEY!,
});

const customers = await client.customers.list({
  query: { limit: 25 },
});

const estimate = await client.estimates.create({
  customer_id: '8af2ca8e-8f31-4e6e-a46c-0703b61f7ca3',
  currency: 'USD',
  line_items: [
    { name: 'Quarterly hood cleaning', quantity: 1, unit_price: 1825 },
  ],
});
Errors

Non-2xx responses throwAsteriApiErrorso integrations can read the HTTP status, parsed error payload, retry guidance, and returned contract version without string-parsing generic exceptions.

import { AsteriApiError, AsteriPublicApiClient } from '@asteri/public-api-sdk';

const client = new AsteriPublicApiClient({
  baseUrl: 'http://localhost:3000',
  organizationId: process.env.ASTERI_ORG_ID!,
  apiKey: process.env.ASTERI_API_KEY!,
});

try {
  await client.customers.list();
} catch (error) {
  if (error instanceof AsteriApiError) {
    console.error(error.status);
    console.error(error.payload);
    console.error(error.retryAfter);
  }

  throw error;
}
Helpers

The package exports hand-written helpers layered on top of the generated client for common workflows like walking paginated list endpoints across every page.

import { AsteriPublicApiClient, listAllCustomers } from '@asteri/public-api-sdk';

const client = new AsteriPublicApiClient({
  baseUrl: 'http://localhost:3000',
  organizationId: process.env.ASTERI_ORG_ID!,
  apiKey: process.env.ASTERI_API_KEY!,
});

const customers = await listAllCustomers(client, {
  pageSize: 100,
});
Examples

The SDK includes concrete example files you can run directly. Use them as your fastest path to a working integration.

List all customers

Example:packages/public-api-sdk/examples/list-all-customers.ts

ASTERI_BASE_URL=http://localhost:3000 \
ASTERI_ORG_ID=your-org-id \
ASTERI_API_KEY=ast_live_your_key \
pnpm -C packages/public-api-sdk example:list-all-customers
Create an estimate

Example:packages/public-api-sdk/examples/create-estimate.ts

ASTERI_BASE_URL=http://localhost:3000 \
ASTERI_ORG_ID=your-org-id \
ASTERI_API_KEY=ast_live_your_key \
ASTERI_CUSTOMER_ID=customer-uuid \
pnpm -C packages/public-api-sdk example:create-estimate
Release assets

CI publishes preview artifacts to the stable GitHub prerelease tagpublic-api-preview-latestso consumers outside this monorepo can install the SDK tarball or download the OpenAPI file directly.

SDK tarball

Current:asteri-public-api-sdk-0.1.0.tgz

npm install https://github.com/Asteri-Labs/asteri/releases/download/public-api-preview-latest/asteri-public-api-sdk-0.1.0.tgz
OpenAPI artifact

Current:asteri-public-api-openapi.json

curl -L https://github.com/Asteri-Labs/asteri/releases/download/public-api-preview-latest/asteri-public-api-openapi.json -o asteri-public-api-openapi.json
Starter app

The monorepo includes a tiny end-to-end starter app that uses the SDK against the live preview API, supports customer, appointment, and estimate creation, and exposes a local webhook inbox panel at/webhooks/asteri.

App path:apps/public-api-starter

ASTERI_BASE_URL=http://localhost:3000 \
ASTERI_ORG_ID=your-org-id \
ASTERI_API_KEY=ast_live_your_key \
ASTERI_WEBHOOK_SECRET=your_webhook_secret \
PORT=4010 \
pnpm dev:public-api-starter
Regenerate

Whenever the public contract changes, regenerate the client from the current OpenAPI document rather than editing generated code by hand.

pnpm sdk:public-api:generate