Developers
Regenerate the SDK
Keep generated client code synchronized with the OpenAPI contract.
The SDK is generated from the API's development OpenAPI document and lives in packages/sdk/src/generated.
Regenerate after API changes
Start the API locally, then run the root generation command:
# Terminal 1
bun run --filter @ai-dubbing/api dev
# Terminal 2, from the repository root
bun generate:sdkThe generator reads:
http://localhost:3000/openapi/jsonCommit the generated files with the endpoint/schema change. Consumers should never need to hand-edit files under packages/sdk/src/generated.
Update consumers
After generation, install dependencies so workspace links and lockfile metadata are current, then typecheck the consumer:
bun install
bun run --filter @ai-dubbing/client typecheckContract rules
- Add endpoint response schemas before generating. The SDK can only type what appears in OpenAPI.
- Treat exported function names as generated implementation details. The public
/v1paths currently produce names such ascreateDubUploadandgetDub. - Preserve backwards compatibility for consumers, or release the SDK as a versioned package before making breaking endpoint changes.
- Regenerate whenever a request body, response body, route path, or security requirement changes.