@namuh-eng/expn-sdk
Generated TypeScript SDK for the Exponential headless API.
Usage
ts
import { createExponentialClient } from "@namuh-eng/expn-sdk";
const client = createExponentialClient({
baseUrl: process.env.EXPONENTIAL_API_URL,
token: process.env.EXPONENTIAL_TOKEN,
});
const { data, error } = await client.GET("/issues", {
params: { query: { limit: 10 } },
});The SDK is generated from packages/proto/openapi.yaml and is primarily used by
the Exponential CLI, MCP server, and web app runtime clients.
Use an API base URL that ends in /v1:
bash
export EXPONENTIAL_API_URL=http://localhost:7016/v1
export EXPONENTIAL_TOKEN=pat_your_tokenGeneration
Regenerate after changing packages/proto/openapi.yaml:
bash
pnpm --filter @namuh-eng/expn-sdk generateThe generated types are written to packages/sdk/src/generated.ts. Do not edit
that file by hand; update the OpenAPI contract instead.
If a contract change also affects the Go API, regenerate the Go stubs too:
bash
scripts/generate-go-openapi.pyValidation
bash
pnpm --filter @namuh-eng/expn-sdk typecheck
pnpm --filter @namuh-eng/expn-sdk test
pnpm --filter @namuh-eng/expn-sdk buildThe repo-level make check command also verifies OpenAPI coverage, generated
Go stubs, and migrated web SDK usage.
Consumers
apps/clipublishes@namuh-eng/expn-cliand depends on this SDK.packages/mcp-serverexposes read-only MCP tools through this SDK.apps/webuses SDK-backed clients for migrated runtime slices while keeping
browser traffic same-origin through /api/* rewrites.