Node.js & Bun Quickstart
Get started with Rivet Actors in Node.js and Bun
Install RivetKit
Create an Actor
Create a simple counter actor:
Setup Server
Choose your preferred web framework:
The /registry
endpoint is automatically mounted by RivetKit and is required for client communication. When using serve()
with Hono, this is handled automatically.
Run Server
Your server is now running at http://localhost:8080
Test Your Actor
Test your counter actor using HTTP requests:
Deploy
By default, RivetKit stores actor state on the local file system and will not scale in production.
The following providers let you deploy & scale RivetKit:
Rivet provides open-source infrastructure to deploy & scale RivetKit. To deploy to Rivet, provide this config:
And deploy with:
Your endpoint will be available at your Rivet project URL.
Rivet provides open-source infrastructure to deploy & scale RivetKit. To deploy to Rivet, provide this config:
And deploy with:
Your endpoint will be available at your Rivet project URL.
Deploy to Cloudflare Workers, install the Cloudflare Workers driver:
Update your server.ts
to support Cloudflare Workers:
Update your configuration file to support ACTOR_DO
and ACTOR_KV
bindings:
Finally, deploy:
For production with Redis storage, install the Redis driver:
Then configure the driver:
Your backend can now be deployed to your cloud provider of choice.
Configuration Options
Connect Frontend To The Rivet Actor
Create a type-safe client to connect from your frontend:
See the JavaScript client documentation for more information.
See the JavaScript client documentation for more information.
See the React documentation for more information.
See the Rust client documentation for more information.