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 auth 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. Read the specification documentation and 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.
Announcing Rivet Functions – open-source serverless for your backend logic.
Ready to deploy your first function? Check out the Functions docs at rivet.gg/docs/functions to get up and running in minutes.
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-cli
npm i -g rivet-cli
If 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