docs: add TypeScript SDK reference section#284
Conversation
Adds four pages under typescript-sdk/ covering overview, retries and timeouts, pagination, and error handling. Registers the SDK under a new "SDKs" menu item in the Reference tab, positioned after CLI and API reference.
|
Claude finished @dangrondahl's task in 1m 33s —— View job PR Review: TypeScript SDK Reference Section
Review summaryThis is a well-structured addition. The four pages follow the reference Diataxis type correctly — factual, lookup-oriented, and not mixed with tutorial content. All four new pages are registered in No critical issues found. Findings by file
|
| Category | Count |
|---|---|
| Critical | 0 |
| Improvement | 2 |
| Suggestion | 3 |
Solid reference documentation. The pages are well-scoped, the code examples are consistent, and the early-access warning is correctly placed. The two improvements are about making the pagination response shape and error import paths clearer for readers — both quick fixes.
|
|
||
| const trails = Array.isArray(result) ? result : result.data ?? []; |
There was a problem hiding this comment.
Improvement: result.data appears here as a fallback but isn't explained anywhere on the page. If the SDK response actually has a .data property, it would be worth documenting the response shape (e.g. { data: Trail[], pagination?: {...} }) so readers know what to expect. If it doesn't, this fallback may confuse more than it helps.
| - **Bun**: v1 and above | ||
| - **Deno**: v1.39+ | ||
|
|
||
| For TypeScript projects, add `"lib": ["es2020", "dom", "dom.iterable"]` to your `tsconfig.json` to get full type support for async iterables, streams, and fetch-related APIs. |
There was a problem hiding this comment.
Suggestion: This reads as though users should set lib to exactly these three entries. Consider phrasing as "ensure your lib array includes at least…" so users with existing entries (e.g. "es2021", "webworker") don't accidentally drop them.
| For TypeScript projects, add `"lib": ["es2020", "dom", "dom.iterable"]` to your `tsconfig.json` to get full type support for async iterables, streams, and fetch-related APIs. | |
| For TypeScript projects, ensure your `tsconfig.json` `lib` array includes at least `"es2020"`, `"dom"`, and `"dom.iterable"` for full type support for async iterables, streams, and fetch-related APIs. |
| A small number of operations can throw additional error types for specific conditions: | ||
|
|
||
| | Class | Status | Description | | ||
| |-------|--------|-------------| | ||
| | `ConflictResponseModelError` | `409` | Conflict (e.g. resource already exists) | | ||
| | `RequestEntityTooLargeResponseModelError` | `413` | Request body too large | | ||
| | `ResponseValidationError` | - | Response from server did not match the expected schema; inspect `error.rawValue` or call `error.pretty()` | | ||
|
|
||
| Check the method's documentation to see which errors apply to a specific operation. |
There was a problem hiding this comment.
Improvement: These additional error types aren't shown in the import * as errors from "@kosli/sdk/models/errors" examples above. A brief note confirming they come from the same import path would save readers from guessing.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
Summary
typescript-sdk/:AbortSignalpage/perPageparams, body pagination object, Link header pattern, page-iteration exampleKosliErrorbase class, named error subclasses (BadRequestError,UnauthorizedError,NotFoundError,RateLimitedError), network errorsNotes
Test plan
/user/personal_api_keysand/administration/authentication/service_accountsresolve