The modern way to build multiplayer, realtime, or AI agent backends.
Runs on Rivet, Cloudflare Workers, Bun, and Node.js. Integrates with Hono and Redis.
- πΎ Persistent, 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, actions, 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.
- π» Actions: Callable functions 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 provides a solid foundation with the features you'd expect for modern apps.
Feature | ActorCore | Durable Objects | Socket.io | Redis | AWS Lambda |
---|---|---|---|---|---|
In-Memory State | β | β | β | β | |
Persisted State | β | β | |||
Actions (RPC) | β | β | β | β | |
Events (Pub/Sub) | β | - | β | β | |
Scheduling | β | - | - | ||
Edge Computing | β β | β | β | ||
No Vendor Lock | β | β | β |
- = requires significant boilerplate code or external service
β = on supported platforms
Run this command:
npx create-actor@latest
Create Actor
import { actor, setup } from "actor-core";
const chatRoom = actor({
state: { messages: [] },
actions: {
// receive an action call from the client
sendMessage: (c, username: string, message: string) => {
// save message to persistent storage
c.state.messages.push({ username, message });
// broadcast message to all clients
c.broadcast("newMessage", username, message);
},
// allow client to request message history
getMessages: (c) => c.state.messages
},
});
export const app = setup({
actors: { chatRoom },
cors: { origin: "http://localhost:8080" }
});
export type App = typeof app;
Connect to Actor
import { createClient } from "actor-core/client";
import type { App } from "../src/index";
const client = createClient<App>(/* manager endpoint */);
// connect to chat room
const chatRoom = await client.chatRoom.get({ channel: "random" });
// 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.");
- 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