Backend
Next.js
Next.js is a powerful React framework that allows you to build server-rendered applications with ease. The Rivet Next.js client enables you to connect to and interact with actors in your Next.js applications.
View Example on GitHub
Check out the complete example
View client integration
Use the RivetKit React client to connect to actors
Basic Usage
Installation
Install the RivetKit Next.js package:
Create an Actor
Create a simple counter actor:
src/rivet/registry.ts
Setup Registry API routes
src/app/api/registry/[...all]/route.ts
API Reference
toNextHandler
Converts a RivetKit server to a Next.js handler for API routes.
TypeScript
Parameters
server
: The RivetKit server instance created from your registry.
Returns
- An object containing Next.js-compatible handlers for the HTTP methods.