Quickstart
Node.js & Bun Quickstart
Get started with Rivet Actors in Node.js and Bun
Steps
Install Rivet
Command Line
Create an Actor
Create a simple counter actor:
registry.ts
Setup Server
Integrate with your preferred web framework:
Run Server
Your server is now running. See Server Setup for runtime-specific configurations.
Connect To The Rivet Actor
This code can run either in your frontend or within your backend:
client.ts
See the JavaScript client documentation for more information.
Counter.tsx
See the React documentation for more information.
Deploy
By default, Rivet stores actor state on the local file system.
To scale Rivet in production, follow a guide to deploy to your hosting provider of choice:
Configuration Options
- Server Setup: Different ways to run your server with serve(), handler(), or framework adapters.
- Clients: Connect to actors from JavaScript, React, or other platforms.
- Authentication: Secure actor connections with custom authentication logic.
- CORS: Configure origin restrictions to secure your actors from unauthorized access.
- Logging: Configure logging output for debugging and monitoring.
- Runtime Modes: Serverless vs runners for different deployment scenarios.