Requirements

  • Node.js 20.11+
  • A Zero Runtime auth token from the dashboard
  • API keys for the providers you use

Install

The package ships compiled JavaScript plus complete type declarations, so both languages are first class: TypeScript runs directly with tsx, JavaScript needs no build step at all. Every provider ships with the SDK; most need no extra package, because their credential is a string you set in the environment.

Connect to the Runtime

Point the worker at your runtime address, and set your auth token, using the values from the dashboard:
The SDK reads a .env from the working directory if you add import 'dotenv/config'; at the top of your entrypoint.

Conventions

  • Extend Agent and implement on_enter() and on_exit().
  • Use Pipeline() and provider functions directly.
  • Use function_tool() to define tools.
  • Access the current session with this.session! inside agents.
  • Import core APIs from @zeroruntime/js-sdk and providers from @zeroruntime/js-sdk/plugins.

Example

main.ts
Run it with npx tsx main.ts. The playground URL is printed once, on stdout — open it to talk to the agent.
Pass the agent class to serve(), not an instance. serve() builds a fresh agent and pipeline per call, which is what keeps per-call state correct under concurrent calls.

API reference

Node JS SDK API reference

Every export, type, and option in the Node JS SDK.
The Quickstart shows a complete agent. Runnable examples are at zeroruntime-js-examples.