rivetkit-client-react
React client for connecting to Rivet Actors with hooks and realtime state management.
- Create typed hooks with
createRivetKit()and connect to actor instances usinguseActor()with keys and optional parameters - Subscribe to actor events with
useEvent()and monitor connection lifecycle throughconnStatusand error states - Use
createClient()for stateless one-off calls, actor discovery methods (get, getOrCreate, create, getForId), and low-level HTTP/WebSocket access - Supports compound array keys for hierarchical actor addressing, automatic environment variable configuration, and explicit error handling via
ActorError
RivetKit React Client
Use this skill when building React apps that connect to Rivet Actors with @rivetkit/react.
First Steps
- Install the React client (latest: 2.3.0-rc.5)
npm install @rivetkit/react@2.3.0-rc.5 - Create hooks with
createRivetKit()and connect withuseActor().
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-javascript
RivetKit JavaScript client guidance. Use for browser, Node.js, or Bun clients that connect to Rivet Actors with rivetkit/client, create clients, call actions, or manage connections.
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