The modern way to build multiplayer, realtime, or AI agent backends.
Supports Rivet, Cloudflare Workers, Bun, and Node.js.
- πΎ Durable, In-Memory State: Fast in-memory access with built-in durability β no external databases or caches needed.
- β‘ Ultra-Fast State Updates: Real-time state updates with ultra-low latency, powered by co-locating compute and data.
- π Batteries Included: Integrated support for state, RPC, events, scheduling, and multiplayer β no extra boilerplate code needed.
- π₯οΈ Serverless & Scalable: Effortless scaling, scale-to-zero, and easy deployments on any serverless runtime.
- πΎ State: Fast in-memory access with built-in durability.
- π» RPC: Remote procedure calls for seamless client-server communication.
- π‘ Events: Real-time event handling and broadcasting.
- β° Scheduling: Timed tasks and operations management.
- π Connections & Multiplayer: Manage connections and multiplayer interactions.
- π·οΈ Metadata: Store and manage additional data attributes.
ActorCore is the modern way to build realtime, stateful backends.
Feature | ActorCore | Durable Objects | AWS Lambda | Redis | Socket.io |
---|---|---|---|---|---|
In-Memory State | β | β | β | β | |
Durable State | β | β | |||
RPC | β | β | β | β | |
Events | β | β | |||
Scheduling | β | ||||
Edge Computing | β β | β | β | ||
No Vendor Lock | β | β | β |
β = on supported platforms
# npm
npm add actor-core
# pnpm
pnpm add actor-core
# Yarn
yarn add actor-core
# Bun
bun add actor-core
import { Actor, type Rpc } from "actor-core";
export interface State {
messages: { username: string; message: string }[];
}
export default class ChatRoom extends Actor<State> {
// initialize this._state
_onInitialize() {
return { messages: [] };
}
// receive an remote procedure call from the client
sendMessage(rpc: Rpc<ChatRoom>, username: string, message: string) {
// save message to persistent storage
this._state.messages.push({ username, message });
// broadcast message to all clients
this._broadcast("newMessage", username, message);
}
}
import { Client } from "actor-core/client";
import type ChatRoom from "../src/chat-room.ts";
const client = new Client(/* manager endpoint */);
// connect to chat room
const chatRoom = await client.get<ChatRoom>({ name: "chat" });
// listen for new messages
chatRoom.on("newMessage", (username: string, message: string) =>
console.log(`Message from ${username}: ${message}`)
);
// send message to room
await chatRoom.sendMessage("william", "All the world's a stage.");
Deploy to your platform of choice:
- Join our Discord
- Follow us on X
- Follow us on Bluesky
- File bug reports in GitHub Issues
- Post questions & ideas in GitHub Discussions
Apache 2.0