Back to Rivet

Next.js

examples/next-js/README.md

2.2.11.0 KB
Original Source

Next.js

Minimal Next.js example demonstrating basic actor state management and real-time updates.

Getting Started

sh
git clone https://github.com/rivet-dev/rivet.git
cd rivet/examples/next-js
npm install
npm run dev

Features

  • Next.js 15 integration: Use RivetKit with Next.js App Router and server actions
  • Real-time updates: Counter values synchronized across all connected clients
  • Actor state management: Persistent counter state managed by Rivet Actors
  • Multiple actor instances: Each counter ID creates a separate actor instance

Implementation

This example demonstrates minimal Next.js integration with Rivet Actors:

  • Actor Definition (src/rivet/actors.ts): Simple counter actor integrated with Next.js App Router

Resources

Read more about Next.js integration, actions, state, and events.

License

MIT