ActorCore

Stateful, Scalable, Realtime
Backend Framework

The modern way to build multiplayer, realtime, or AI agent backends.

Runs on Rivet, Durable Objects, Bun, and Node.js. Supports JavaScript, TypeScript, and Rust. Integrates with Hono and Redis.

Get Started

npx create-actor@latest

import { actor } from "actor-core";

const chatRoom = actor({
  state: { messages: [] },
  actions: {
    // receive an action call from the client
    sendMessage: (c, username, message) => {
      // 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
  }
});

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.

Features

Everything you need to build realtime, stateful backends

ActorCore provides a solid foundation with the features you’d expect for modern apps.

FeatureActorCoreVanilla Durable ObjectsSocket.ioRedisAWS Lambda
In-Memory State
Persisted State
Actions
Events (Pub/Sub)
Scheduling
Edge Computing¹
No Vendor Lock

= requires significant boilerplate code or external service

¹ = on supported platforms

Overview

1

Create Actor

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;
2

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.");

Platforms

Community & Support