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.
The `rivetkit-client-react` skill provides a comprehensive framework for integrating Rivet Actors into React applications. It simplifies the process of connecting to remote actors, managing real-time state, and creating reusable hooks using `createRivetKit` and `useActor`. By leveraging this client, developers can efficiently handle asynchronous communication and state updates between React components and Rivet Actors, minimizing boilerplate code and reducing the complexity of managing real-time connections manually.
Key features of this skill include the ability to create hooks for actor connections, manage both stateless and stateful actor interactions, subscribe to actor events, and handle connection lifecycles robustly. It supports fail-fast error handling, explicit logging for caught errors, and provides flexible connection parameters including authentication tokens. Developers can also use the low-level client for direct actor manipulation, enabling operations like get, getOrCreate, create, and getForId, which facilitates advanced use cases and server-side interactions.
This skill is ideal for React developers building applications that require real-time collaboration, dynamic data updates, or interactive components tied to remote stateful actors. Use cases include chat applications, collaborative dashboards, live counters, and game state management. Target users are frontend engineers familiar with React who need a structured, reliable way to integrate Rivet Actors without building custom real-time infrastructure from scratch.
Use `createRivetKit()` to create hooks and `useActor()` within your component to establish a connection to the desired actor.
Yes, for stateless interactions or SSR, you can use the low-level `createClient` to perform one-off actor calls.
Prefer fail-fast behavior by default. Only use `try/catch` when necessary, and always handle errors explicitly, such as logging them.
It is compatible with React applications that can use hooks. Ensure you are using a React version that supports hooks.
Yes, the `useActor` hook allows subscribing to events via `useEvent`, enabling real-time event handling in your components.
Quick Setup:
.claude/skills/Repository
rivet-dev/skills