Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion content/docs/api/client-sdk.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,6 +25,41 @@ The `@objectstack/client` is the official TypeScript client for ObjectStack. It
pnpm add @objectstack/client
```

{/*
CONTRIBUTOR NOTE — none of this page's TypeScript fences carries an
`os:check` marker, and that is a recorded decision rather than an omission.

`check:skill-examples` compiles marked blocks per SURFACE. `content/docs/**`
belongs to the "skills + docs" surface, whose resolution dir and `paths` map
are derived from `@objectstack/spec` alone — and `@objectstack/spec` does not
depend on `@objectstack/client`. So a marker on any fence that imports the SDK
reds with TS2307 "Cannot find module '@objectstack/client'" — a
surface-resolution gap, not doc-vs-SDK drift.

Every other fence is a deliberate continuation fragment: Quick Start
establishes `client` once and each later block continues that implied context,
so a marker there reds with TS2304 "Cannot find name 'client'". Making either
class compile would mean hand-declaring the SDK's own types, or injecting
casts into prose whose subject IS the real API — pinning each example to
itself and teaching worse code than the page teaches now.

Measured on this page (all 13 fences marked, then reverted): 128 diagnostics,
every one TS2307 / TS2304 / TS18004 / TS18046 / TS2591 / TS7006 / TS7026 /
TS2875. Not one was a doc-vs-SDK divergence.

The React Hooks block near the end is fenced tsx, not typescript, because it
IS JSX: the gate writes every block out with its fence's own extension, and
JSX in a .ts file is a syntax error. That reaches past this page — tsc stops
at syntax errors and never runs the semantic pass, so one such block would
suppress type-checking for every marked block across skills/ and
content/docs/ (measured here: 128 semantic diagnostics collapse to 0). Please
do not retag it back.

The marker becomes worth adding here the day the docs surface can resolve
`@objectstack/client` — the same condition recorded in
content/docs/kernel/runtime-services/data-service.mdx.
*/}

## Quick Start

```typescript
Expand DownExpand Up@@ -636,7 +671,7 @@ For React applications, use `@objectstack/client-react`:
pnpm add @objectstack/client-react
```

```typescript
```tsx
import { ObjectStackProvider, useClient, useQuery } from '@objectstack/client-react';
import { ObjectStackClient } from '@objectstack/client';

Expand Down
Loading