Features
- Actor state management: Persistent counter state managed by Rivet Actors
- Real-time updates: Counter values synchronized across all connected clients via events
- Multiple actor instances: Each counter ID creates a separate actor instance
- React integration: Uses
@rivetkit/reactfor seamless React hooks integration
Implementation
This example demonstrates the core RivetKit concepts with a simple counter:
- Actor Definition (
src/actors.ts): Counter actor with persistent state and broadcast events - Server Setup (
src/server.ts): Minimal Hono server with RivetKit handler - React Frontend (
frontend/App.tsx): Counter component usinguseActorhook and event subscriptions

