Skip to content

Examples ​

Every example below is typechecked against the package source on each docs build, so they stay current with the API.

ExampleShowsGuide
quick-start.tsA complete turn with approvals, a deadline, and cleanupFirst conversation
readme.tsThe shortest streaming conversationHome
streaming.tsRunning a turn and collecting text and diffStream events
history.tsPaging threads and turns, resuming a threadThreads and turns
tools.tsAn app-owned dynamic tool with argument validationApprovals and tools
authentication.tsReading account state and browser loginAuthentication
unix-socket.tsAttaching to a running app-serverConnect to Codex
reconnect.tsKeeping a client connected across failuresReconnect and recover

Run npm run typecheck:docs after changing an example.

Released under the Apache License 2.0.