SDK Features
All features generated in TypeScript SDKs by OpenSDK.
OpenSDK generates a complete TypeScript SDK with up to 14 feature modules, depending on what the API supports. Features are auto-detected from the spec.
Generated Modules
| Module | File | Description |
|---|---|---|
| Client | src/client.ts | Main client class with typed methods for every endpoint |
| Types | src/types.ts | Client configuration interface |
| Models | src/models.ts | TypeScript interfaces for all schemas |
| Auth | src/auth.ts | API key, Bearer, Basic, or OAuth 2.0 (with PKCE + refresh) |
| Retry | src/retry.ts | Exponential backoff with jitter for retryable endpoints |
| Errors | src/errors.ts | Typed error classes (timeout, auth, rate limit, not found) |
| Pagination | src/pagination.ts | Cursor, offset, and page-based async generators |
| Streaming | src/streaming.ts | EventStream class for SSE with async iteration |
| Multipart | src/multipart.ts | FormData builder for file upload endpoints |
| Idempotency | src/idempotency.ts | Auto-generated idempotency keys for safe retries |
| Interceptors | src/interceptors.ts | Request/response hooks (before, after, error) |
| Typed Errors | src/typed-errors.ts | Per-status-code error classes from endpoint error definitions |
| Environments | src/environments.ts | Named environment presets (production, staging, sandbox) |
| Index | src/index.ts | Barrel export of all active modules |
Feature Detection
Features are auto-detected from the API spec:
- Auth -- security schemes in the spec
- Pagination --
cursor,offset,limit, orpagequery parameters - Retries -- endpoints marked as retryable or safe HTTP methods
- Streaming --
text/event-streamresponse content type - Multipart --
multipart/form-datarequest body - Idempotency -- endpoints with idempotency header annotations
- Typed errors -- endpoints with error response schemas
- Environments -- multiple server URLs in the spec
- Timeouts -- per-endpoint timeout annotations
SDK Output Structure
my-sdk/
src/
client.ts
types.ts
models.ts
auth.ts
retry.ts
errors.ts
pagination.ts
streaming.ts
interceptors.ts
index.ts
package.json
tsconfig.jsonEvery generated SDK is a standalone TypeScript package. Run npm run build to compile, or import directly with a bundler.