Skip to main content
This release is 0 versions behind 24.6.1 — the latest version of @rivet-gg/actor-client. Jump to latest

🔧 Rivet Actors have built-in RPC, state, and events — the easiest way to build modern applications.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
64%
Published
2 days ago (24.6.1-rc.2)

Rivet Actor Client

Rivet Actors have built-in RPC, state, and events — the easiest way to build modern applications.

Getting Started

Example

import { Client } from "@rivet-gg/actor-client";
import type Counter from "./counter.ts";

const client = new Client(/* CONNECTION ADDRESS */);

// Get-or-create a counter actor
const counter = await client.get<Counter>({ name: "counter" });

// Listen for update count events (https://rivet.gg/docs/events)
counter.on("count", (count: number) => console.log("New count:", count));

// Increment the count over remote procedure call (https://rivet.gg/docs/rpc)
await counter.increment(1);

// Disconnect from the actor when finished (https://rivet.gg/docs/connections)
await counter.dispose();

See setup guide for how to access /* CONNECTION ADDRESS */.

Community & Support

License

Apache 2.0

Add Package

deno add jsr:@rivet-gg/actor-client

Import symbol

import * as actor_client from "@rivet-gg/actor-client";

---- OR ----

Import directly with a jsr specifier

import * as actor_client from "jsr:@rivet-gg/actor-client";

Add Package

npx jsr add @rivet-gg/actor-client

Import symbol

import * as actor_client from "@rivet-gg/actor-client";

Add Package

yarn dlx jsr add @rivet-gg/actor-client

Import symbol

import * as actor_client from "@rivet-gg/actor-client";

Add Package

pnpm dlx jsr add @rivet-gg/actor-client

Import symbol

import * as actor_client from "@rivet-gg/actor-client";

Add Package

bunx jsr add @rivet-gg/actor-client

Import symbol

import * as actor_client from "@rivet-gg/actor-client";