Quickstart
Next.js Quickstart
Get started with Rivet Actors in Next.js
Create a Next.js App
Command Line
Install RivetKit
Create an Actor
Create a file at src/rivet/registry.ts with a simple counter actor:
src/rivet/registry.ts
Setup Rivet API route
Create a file at src/app/api/rivet/[...all]/route.ts to setup the API routes:
src/app/api/rivet/[...all]/route.ts
Use the Actor in a component
Create a file at src/components/Counter.tsx to use the actor in a component:
src/components/Counter.tsx
Import the
Counter component in your page or layout to use it.For more examples on connecting to your actors using React, check the React documentation for RivetKit.
Deploy to Vercel
See the Vercel deployment guide for detailed instructions on deploying your RivetKit app to Vercel.
API Reference
For detailed information about the Next.js client API, see the React Client API Reference.