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.
The `rivetkit-client-javascript` skill is designed for building JavaScript-based clients that can connect to Rivet Actors. This skill is applicable for browser, Node.js, or Bun environments, providing seamless integration with Rivet's actor-based architecture. The skill helps developers easily manage client-server communication, enabling them to create clients, call actions on actors, and manage connections. By using the `rivetkit/client` library, developers can interact with Rivet Actors in a more efficient and structured way, reducing the complexity of dealing with backend communication directly.
To install the RivetKit JavaScript client, run the command `npm install [email protected]`.
A stateless connection means each call is independent, whereas a stateful connection keeps the connection open for real-time events, allowing for continuous interaction with the actor.
Yes, you can use `getParams` to pass dynamic connection parameters that can change between connection attempts, such as refreshing a JWT token before each connection.
Yes, RivetKit prefers a fail-fast error-handling approach, and it is recommended to avoid using `try/catch` unless necessary. Errors should be handled explicitly, at a minimum by logging them.
You can subscribe to various events like `onOpen`, `onClose`, `onError`, and `onStatusChange` for connection lifecycle management, as well as custom events like `message` or `gameOver` depending on your actors.
Quick Setup:
.claude/skills/Repository
rivet-dev/skills