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)
type alias ActorHandle

Connection to an actor. Allows calling actor's remote procedure calls with inferred types. See ActorHandleRaw for underlying methods.

Examples

Example 1

const room = await client.get<ChatRoom>(...etc...);
// This calls the rpc named `sendMessage` on the `ChatRoom` actor.
await room.sendMessage('Hello, world!');

Private methods (e.g. those starting with _) are automatically excluded.

Type Parameters

A = unknown

The actor class that this handle is connected to.

Definition

ActorHandleRaw & [K in keyof A in keyof K extends string ? K extends `_${string}` ? never : K : K]: A[K] extends (...args: infer Args) => infer Return ? ActorRPCFunction<Args, Return> : never

See

Add Package

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

Import symbol

import { type ActorHandle } from "@rivet-gg/actor-client";

---- OR ----

Import directly with a jsr specifier

import { type ActorHandle } from "jsr:@rivet-gg/actor-client";

Add Package

npx jsr add @rivet-gg/actor-client

Import symbol

import { type ActorHandle } from "@rivet-gg/actor-client";

Add Package

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

Import symbol

import { type ActorHandle } from "@rivet-gg/actor-client";

Add Package

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

Import symbol

import { type ActorHandle } from "@rivet-gg/actor-client";

Add Package

bunx jsr add @rivet-gg/actor-client

Import symbol

import { type ActorHandle } from "@rivet-gg/actor-client";