rivetkit-client-javascript
Official RivetKit JavaScript client guidance for browser, Node.js, and Bun. Manage Rivet Actor connections, state, RPC actions, and events.
Introduction
The RivetKit JavaScript client skill provides comprehensive guidance for developers integrating Rivet Actors into browser, Node.js, or Bun environments. It enables seamless communication with high-performance, in-memory processes, facilitating real-time state management, RPC calls, and bidirectional event streaming. This skill is essential for engineers building reactive frontend interfaces, server-side backend services, or cross-platform applications that require geo-distributed, actor-based architecture.
-
Client initialization using createClient with support for custom endpoints and environment variable configuration.
-
Stateful and stateless actor interaction patterns, allowing for robust connection lifecycle management, including automatic reconnection and event subscription.
-
Advanced RPC capabilities, supporting direct action invocation and low-level WebSocket or HTTP fetch interaction for specific actor implementations.
-
Complex data handling with structured keys to prevent injection attacks and ensure secure, hierarchical addressing of actor instances.
-
Support for dynamic authentication and connection parameters through params and getParams for secure token rotation and JWT management.
-
Use this skill when defining how your application interacts with the Rivet runtime to ensure high concurrency and low latency.
-
Follow the fail-fast error handling policy to maintain application stability; utilize the ActorError class for granular feedback on failed actions or rejected connections.
-
When implementing, ensure your actor registry is correctly imported to leverage TypeScript support and end-to-end type safety across the client-server boundary.
-
Pay close attention to connection lifecycle events like onOpen, onClose, and onStatusChange to provide a responsive user experience in distributed environments.
-
Use the provided patterns for backend-side calls to integrate RivetKit actors with existing HTTP frameworks like Hono, Express, or Elysia.
Repository Stats
- Stars
- 14
- Forks
- 2
- Open Issues
- 1
- Language
- Not provided
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- Apr 30, 2026, 09:29 AM