Deploying to Netlify
Deploy your RivetKit app to [Netlify](https://netlify.com/).
Steps
Prerequisites
- Netlify account
- Your RivetKit app
- If you don’t have one, see the Quickstart page or our Examples
- Access to the Rivet Cloud or a self-hosted Rivet Engine
Prepare Your Application
Make sure your project is configured correctly for Netlify deployment.
Your Hono project needs:
- Install the Netlify Functions package:
- A
netlify.tomlfile with the functions and redirect configuration:
- A function handler that forwards requests to your Hono app:
See the Hello World template for a complete example.
Your Next.js project should have the following structure:
src/app/api/rivet/[...all]/route.ts: RivetKit route handlersrc/actors.ts: Actor definitions and registry
Configure your Next.js project for Netlify by installing the Netlify adapter:
Add a netlify.toml file:
See the Next.js quickstart to get started with a Next.js + RivetKit app.
Netlify supports many frameworks through build plugins and adapters:
- Astro: Use
@astrojs/netlifyadapter - SvelteKit: Use
@sveltejs/adapter-netlify - Nuxt: Use
@nuxtjs/netlify-builder - Remix: Use
@netlify/remix-adapter
For frameworks not listed above, you can usually deploy using Netlify Functions with the patterns shown in the “Hono” tab.
Deploy to Netlify
-
Connect your Git repository to Netlify:
- Visit Netlify and sign in
- Click “Add new site” > “Import an existing project”
- Connect your Git provider and select your repository
-
Configure build settings:
- Build command and publish directory are configured in your
netlify.toml
- Build command and publish directory are configured in your
-
Deploy your site:
- Netlify will automatically build and deploy your app
- You’ll receive a unique Netlify URL (e.g.,
https://amazing-app-123456.netlify.app)
More information on deployments is available in Netlify’s docs.
Set Environment Variables
-
In your Netlify site dashboard, go to Site settings > Environment variables
-
Add the following environment variables (provided after creating your project in the Rivet dashboard):
RIVET_ENDPOINT: Your Rivet backend endpointRIVET_PUBLIC_ENDPOINT: Your frontend-safe Rivet endpoint
-
Redeploy your site to apply the environment variables
See Netlify’s environment variables docs for more details.
Connect and Verify
- Visit the Rivet dashboard
- Navigate to Connect > Netlify
- Skip to the Deploy to Netlify step
- Input your deployed Netlify site URL
- e.g.
https://amazing-app-123456.netlify.app/api/rivet
- e.g.
- Once it shows as successfully connected, click Done
Your Netlify deployment is now connected to Rivet.