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 Counter component and add it to your page:
src/components/Counter.tsx
src/app/page.tsx
For information about the Next.js client API, see the React Client API Reference.
Deploy to Vercel
See the Vercel deployment guide for detailed instructions on deploying your Rivet app to Vercel.