Skip to content

API Reference generated from source

The API Reference reads Zhin's public authoring entries, Host contracts, and JSDoc directly. Signatures, generics, source locations, and deprecation markers are regenerated with every documentation build.

Open the complete API Reference →

Choose the right layer

GoalStart with
Define a pluginzhin.js
Author commandszhin.js/command
Build an Adapterzhin.js/adapter
Author componentszhin.js/component
Author middlewarezhin.js/middleware
Author handlerszhin.js/handler
Author Agent Tools@zhin.js/tool; agent/tools/ may also import from zhin.js/agent
Parse Skill Markdown@zhin.js/skill
Inject Prompt Sections@zhin.js/prompt-section (experimental)
Use database, scheduling, and cross-platform messaging HostsdatabaseHostToken, scheduleHostToken, and outboundHostToken from zhin.js
Register HTTP / WebSocket routeshttpHostToken from @zhin.js/host-http
Integrate with the IM message gatewaymessageGatewayToken from zhin.js/core/runtime
Register Agent capability resourcesAgentResourceHub from zhin.js/agent (experimental)

The reference answers “what is the signature?” Guides answer “how should these pieces work together?” Start with plugin authoring and use the Public API surface for stability guarantees.

Maintenance contract

Run pnpm docs:api to generate the site and pnpm check:api-docs for type and comment validation. Unknown JSDoc tags, broken symbol links, and TypeScript errors fail the gate.

The generator accepts only authoring entries and Host contracts promised by the Public API SSOT. Exported internals such as *Index, repositories, Root Runtime mechanisms, parsers, and assembly helpers are not published as user APIs. A reflection allowlist fails CI whenever the public surface drifts.

Generated files live in docs/public/api and are not committed. The GitHub Pages workflow runs pnpm docs:build, which generates the reference before VitePress publishes both sites.