
Rivet now supports programmatically deploying AI-generated and user-generated actor code to sandboxed namespaces, enabling use cases like AI code execution, user sandbox environments, preview deployments, and multi-tenant applications.
When AI agents generate backend code, they typically need to coordinate across multiple disconnected systems:
Each system requires separate context, increasing token usage and cognitive load for the AI. More importantly, state and behavior can drift apart when defined separately, leading to bugs and inconsistencies.
Rivet Actors solve this by unifying state and logic in a single actor definition. Instead of coordinating between databases and APIs, state and behavior live together:
This consolidation eliminates fragmentation:
Sandboxed namespaces provide isolated environments where each AI-generated or user-generated deployment runs independently with its own resources, tokens, and configuration. This enables safe multi-tenant deployments and user-generated code execution.
Sandboxed namespaces enable a variety of isolated deployment scenarios:
The deployment process involves four key steps:
Create sandboxed namespace: Programmatically create an isolated Rivet namespace using the Cloud API or self-hosted Rivet API
Generate tokens: Create the necessary authentication tokens:
Deploy code: Deploy the actor code and frontend programmatically to your serverless platform of choice (Vercel, Netlify, AWS Lambda, Freestyle, etc.)
Connect Rivet: Configure Rivet to run actors on your deployment in your sandboxed namespace
Here's a simplified example of the deployment flow using Freestyle (built specifically for this use case):
Call this deployment function whenever your AI agent generates new actor code or a user requests their own sandbox environment. The entire process takes seconds and creates a fully isolated, production-ready deployment.
To try deploying AI-generated or user-generated Rivet Actors:

Rivet now supports keeping WebSocket connections alive while actors upgrade, migrate, crash, or sleep. This eliminates many of the biggest pain points of building realtime applications with WebSockets.
This is fully W3C compliant and requires no custom API changes to integrate.
Traditionally, applications opt to use stateless HTTP requests over WebSockets because:
We set out to solve this by enabling WebSockets to Rivet Actors to stay open while the actor upgrades, migrates, crashes, or goes to sleep.
This comes with a series of benefits that previously were only possible using stateless HTTP requests:
If using the actions & events API, upgrade to Rivet v2.0.24 and it will work out of the box.
The following code will automatically use WebSocket hibernation. When users are sitting idle connected to the chat room, the actor can go to sleep while still keeping the WebSocket open, ready to send actions or receive events:
Read more about actions and events.
The low-level WebSocket API (onWebSocket) can opt in to WebSocket hibernation starting in Rivet v2.0.24. Configure options.canHibernateWebSocket with either true or a conditional closure based on the request ((request) => boolean).
The open, message, and close events fire as they normally would on a WebSocket. When the actor migrates to a separate machine, c.conn.state is persisted and no new open event is triggered.
For example:
Read more about the low-level WebSocket API.

curl -X POST -d '{"args":[1]}' '127.1:6420/gateway/62558b332d622c0e/action/increment')onWebSocket and onRequest connectionsActorContext.destroy() & new onDestroy hookcreateInlineClient to Cloudflare Workers for talking to actors without exposing the public manager API




Rivet Actors can now run on Vercel Functions, bringing stateful, realtime workloads to Vercel's serverless platform.
Cloudflare's Durable Objects introduced a long-lived, stateful primitive in serverless apps – but they come with platform lock-in and resource constraints. Rivet Actors offer an open-source alternative, and by launching on Vercel we unlock better flexibility, control, and developer experience.
| Dimension | Rivet Actors on Vercel Functions | Cloudflare Durable Objects | Why it matters |
|---|---|---|---|
| Runtime | Standard Node.js (Vercel Functions), full support with npm packages | Custom runtime (workerd), subset of Node.js APIs, partial support with npm packages | Using standard Node.js makes packages and frameworks "just work" and reduces vendor lock-in. |
| Memory / CPU per actor | Configurable up to 4 GB / 2 vCPU | Per-isolate memory cap 128 MB | Memory-heavy workloads are more feasible on Vercel than on Cloudflare |
| Regional control | Configurable specific regions | DOs can be restricted to broad jurisdictions and accept location hints, though limited control | Explicit control helps reduce latency and meet compliance requirements |
| Lock-in / portability | Open-source actor library designed to be portable across standard runtimes/clouds | DOs run on Cloudflare's runtime and APIs, not open-source, not portable | Open source + standard runtimes provide flexibility, enables migrations, and allows for on-prem deployments |
Similar to Durable Objects, Rivet Actors provide long-lived, stateful actors with storage, real-time (WebSockets/SSE), and hibernation. However, unlike Durable Objects, Rivet is open-source and portable — you can self-host or run on any platform.
Long-Lived, Stateful Compute: Each unit of compute is like a tiny server that remembers things between requests – no need to re-fetch data from a database or worry about timeouts. Like AWS Lambda, but with persistent memory between invocations and no timeouts.
Realtime, Made Simple: Update state and broadcast changes in realtime with WebSockets or SSE. No external pub/sub systems, no polling – just built-in low-latency events.
No Database Round Trips: State is stored on the same machine as your compute so reads and writes are ultra-fast. No database round trips, no latency spikes.
Sleep When Idle, No Cold Starts: Actors automatically hibernate when idle and wake up instantly on demand with zero cold start delays. Only pay for active compute time.
Architected For Insane Scale: Automatically scale from zero to millions of concurrent actors. Pay only for what you use with instant scaling and no cold starts.
No Vendor Lock-In: Open-source and fully self-hostable.
Running Rivet Actors on Vercel provides many benefits:
Until today, Vercel Functions have not supported WebSockets. Rivet now enables native WebSockets with code running directly in Vercel Functions, powered by our tunneling technology. This brings the flexibility and power of traditional WebSocket servers like Socket.io to Vercel's fully serverless platform for the first time.
This unlocks use cases like:
Read more about realtime events and the raw WebSocket handler.
A stateful AI chatbot with persistent memory and real-time updates:


Today we are launching Rivet Cloud, the fastest way to deploy and scale your Rivet Actors in production.
Rivet Cloud provides a managed platform for deploying and scaling your Rivet Actors without the complexity of self-hosting. Built on the same open-source Rivet Engine, it offers enterprise-grade reliability with the simplicity of a managed service.


Rivet is now a verified app on the Railway Marketplace. With a few clicks, you can deploy and self-host Rivet on Railway and start building stateful apps anywhere you can run Node.js or Bun—without vendor lock-in.
Open-source alternative to Durable Objects
Durable-Objects-style per-key isolation with portability: run it yourself, keep control of runtime, data, and costs.
Actors
Each Actor owns a key (e.g., a user, room, cart) with single-threaded execution, in-memory state, and persistence. That means no ad-hoc locks, no “who owns this?” routing, and no bolt-on caches.
Built-in visibility
Rivet Inspector gives live views of Actor state, messages, and performance for fast debugging.
AI Agents
Real-Time & Collaboration
Stateful APIs
Distributed Workflows
Choose the Rivet Starter template to explore with an example chat app, or the Rivet template to build your own.
For detailed deployment instructions, see the Railway deployment documentation.




Today, we are releasing Rivet v2.0.
This release is a complete rework that makes it simpler to build stateful workloads anywhere you can run NodeJS or Bun.
Rivet v2.0 decouples storage from the platform. The Rivet Engine now supports:
Actors themselves can use File System or Redis drivers, with more storage options coming soon.
Run Rivet in any environment:
v2.0 introduces multi-region architecture for the Rivet Engine:
Rivet v2.0 is open source under the Apache 2.0 license.
Rivet is now distributed as a library rather than a platform service:

Every API call to a cloud provider is a dependency you can't control.
When we built Rivet Actors – an open-source alternative to Cloudflare Durable Objects – we set out to provide a portable foundation for the novel "stateful serverless" architecture that is gaining traction. However, we felt that we weren't doing enough by just being an open-source alternative – we knew we needed to take a step further to make this ubiquitous.
That's why today, we're introducing RivetKit — a port of our core Rivet Actors service exposed as a portable TypeScript library that runs anywhere & can easily be added to your existing backend.
Instead of needing to sign up for a service or run a Docker container to run Rivet Actors, now it runs natively as a lightweight TypeScript library within your codebase & integrates with your existing infrastructure (e.g. Redis).
Our decision to launch RivetKit as a library was underpinned by the following constraints that we kept hearing developers voice:
As a library, RivetKit can run anywhere your infrastructure runs. Currently, RivetKit supports Redis, filesystem, Rivet Cloud, and Cloudflare Workers. Drivers for more platforms such as Postgres, Vercel, and more are trivial to add.
At its core, RivetKit provides Rivet Actors: long-running tasks with persistence & realtime. Rivet Actors provide a simple primitive that provides the same benefits that would usually require many other external services: RPC, realtime, persistence, and long-running tasks.
Rivet Actors excel at:
A simple Rivet actor that combines persistence & realtime looks like this:
And this can be called from your client of choice. For example, JavaScript:
RivetKit is massive rearchitecture of its predecessor, ActorCore. In the process, ActorCore was rebuilt from the ground up to be a library instead of a framework.
Previously, ActorCore required running as a standalone framework. To setup your actors, you'd write:
Then run the ActorCore framework with:
Now, RivetKit is a lightweight library that can be integrated in to your existing backend like this:
And run with vanilla Node.js:
Previously, ActorCore v0.8 required communicating over HTTP with your actors. To talk to actors from your backend, you needed to make a separate HTTP request to the actor manager server.
Now, RivetKit provides an "inline client" that can communicate with actors directly within your backend. For example:
The new onAuth lifecycle hook provides a way to handle authentication to actors based on intent.
onAuth runs on the edge server before reaching the actor itself – meaning it doesn't require any compute to run on the actor & is safe from denial of service attacks.
For example:
See the authentication documentation for more details.
See the RivetKit + Better Auth integration.
Actors can now communicate with each other by using the client in the context. For example:
When using the React integration for Rivet Actors, calling useActor will share the same underlying WebSocket or SSE connection when communicating with actors & will automatically dispose of the connection when no longer in use.
This means you can call useActor liberally inside your components without complex connection handling logic.
Previously, ActorCore v0.8 used a system of key-value tags to organize actors. This turned to be overkill in practice and added unnecessary complexity under the hood.
This has been replaced with compound keys. Compound keys are either a simple string or an array of strings. The array of strings allows actor keys to inject user-provided strings without having to worry about injection attacks.
For example:
See the new actor handles documentation.
Initializing actors with custom state on what they're responsible for is a common pattern. For example, define an actor like this:
And create it like this:
Read more about creating actors.
Actors now default to using HTTP connections unless explicitly calling .connect() to upgrade to a WebSocket or SSE connection. This allows for faster passing of messages without compromising on enabling high performance WebSocket- & SSE-based connections.
For example:
Read the new connections documentation.
Parameters & input data to actors are now end-to-end encrypted securely. Previously, they were passed as a query parameter which is frequently leaked in logs. Now, they're passed a secure header.
RivetKit now provides an OpenAPI spec to integrate your own clients. See the full openapi.json.
RivetKit will be a collection of powerful lightweight libraries directly into your codebase for better performance, control, and cost efficiency. No SaaS fees or API dependencies.
Ready to replace your SaaS dependencies with portable libraries? Get started with RivetKit today.

We've updated the installation process for the rivet-cli package, making it easier than ever to get started with Rivet. This update ensures a seamless setup process whether you're using npx or installing globally via npm.
rivet-clinpm i -g rivet-cliIf you installed the CLI previously, you can update it with:
For one-time usage, you can always use:

Today we're excited to announce updates to Rivet's pricing model, moving to a more transparent and flexible usage-based system. This change allows developers to better scale their applications while only paying for what they use.
Our new pricing structure is designed to be straightforward and predictable:
For more details about our pricing, visit our pricing page.
If you have any questions about the new pricing model, feel free to reach out to us on Discord or support.

Today we are launching Rivet Actor Inspector to help developers view and inspect Rivet Actors. See and edit things like:

Today we are launching Rivet Actors to help developers build and scale realtime applications. They come with a lot of features like:
Learn more: Rivet Actors Documentation