Examples
Every example below is typechecked against the package source on each docs build, so they stay current with the API.
| Example | Shows | Guide |
|---|---|---|
quick-start.ts | A complete turn with approvals, a deadline, and cleanup | First conversation |
readme.ts | The shortest streaming conversation | Home |
streaming.ts | Running a turn and collecting text and diff | Stream events |
history.ts | Paging threads and turns, resuming a thread | Threads and turns |
tools.ts | An app-owned dynamic tool with argument validation | Approvals and tools |
authentication.ts | Reading account state and browser login | Authentication |
unix-socket.ts | Attaching to a running app-server | Connect to Codex |
reconnect.ts | Keeping a client connected across failures | Reconnect and recover |
Run npm run typecheck:docs after changing an example.