rivetkit-client-javascript
JavaScript client for connecting to Rivet Actors with stateless or stateful connections.
- Supports browser, Node.js, and Bun environments with automatic endpoint detection via environment variables or explicit configuration
- Offers two interaction modes: stateless action calls for independent requests and stateful connections with real-time event subscriptions
- Includes low-level HTTP and WebSocket access for actors implementing
onRequestoronWebSockethandlers - Provides compound array-based keys for hierarchical actor addressing and built-in error handling via
ActorErrorwith code and metadata inspection
RivetKit JavaScript Client
Use this skill when building JavaScript clients (browser, Node.js, or Bun) that connect to Rivet Actors with rivetkit/client.
First Steps
- Install the client (latest: 2.3.0-rc.5)
npm install rivetkit@2.3.0-rc.5 - Create a client with
createClient()and call actor actions.
Error Handling Policy
- Prefer fail-fast behavior by default.
- Avoid
try/catchunless absolutely needed. - If a
catchis used, handle the error explicitly, at minimum by logging it.
Getting Started
More from rivet-dev/skills
sandbox-agent
Deploy, configure, and integrate Sandbox Agent - a universal API for orchestrating AI coding agents (Claude Code, Codex, OpenCode, Amp) in sandboxed environments. Use when setting up sandbox-agent server locally or in cloud sandboxes (E2B, Daytona, Docker), creating and managing agent sessions via SDK or API, streaming agent events and handling human-in-the-loop interactions, building chat UIs for coding agents, or understanding the universal schema for agent responses.
6.1Krivetkit
RivetKit backend and Rivet Actor runtime guidance. Use for building, modifying, debugging, or testing Rivet Actors, registries, serverless/runner modes, deployment, or actor-based workflows.
5.7Krivetkit-client-react
RivetKit React client guidance. Use for React apps that connect to Rivet Actors with @rivetkit/react, create hooks with createRivetKit, or manage realtime state with useActor.
5.5Krivetkit-client-swiftui
RivetKit SwiftUI client guidance. Use for SwiftUI apps that connect to Rivet Actors with RivetKitSwiftUI, @Actor, rivetKit view modifiers, and SwiftUI bindings.
5.3Krivetkit-client-swift
RivetKit Swift client guidance. Use for Swift clients that connect to Rivet Actors with RivetKitClient, create actor handles, call actions, or manage connections.
5.3Kmultiplayer-game
Pragmatic patterns for building multiplayer games: matchmaking, tick loops, realtime state, interest management, and validation.
4.6K