A minimal RivetKit example with no UI framework. The actor lives in src/index.ts and a plain Node script in src/client.ts connects to it via rivetkit/client.
git clone https://github.com/rivet-dev/rivet.git
cd rivet/examples/node-client
pnpm install
pnpm dev # starts the actor envoy + spawns a local engine
pnpm client # in another terminal: runs the client scriptThe example sets startEngine: true, so the registry spawns the engine binary itself. When running from this monorepo (no published platform package installed), point RIVET_ENGINE_BINARY at the workspace dev build:
RIVET_ENGINE_BINARY=$(pwd)/../../target/debug/rivet-engine pnpm dev- Actor definition: Counter actor with persistent state and two actions
- Type-safe client:
createClient<typeof registry>(endpoint)for end-to-end type inference - No UI framework: Pure Node script, suitable as a starting point for CLIs, scripts, or backend-to-actor calls
- Actor + registry (
src/index.ts) - Client script (
src/client.ts) - Tests (
tests/counter.test.ts)
Read more about actions, state, and the client.
MIT