Connecting Your Backend to Rivet Engine
Unless exlpicitly configured, Rivet will default to running on the local file system without using the Rivet Engine. This is perfect for local development and testing.
When ready to scale the backend, RivetKit can connect to a Rivet Engine instance using the RIVET_ENGINE
environment variable.
The engine is not required at any point during development. It is only required to scale RivetKit to multiple nodes.
Connecting Runners
To connect a runner to your Rivet Engine, set the RIVET_ENGINE
environment variable:
Once connected:
- The runner appears in the Runners tab of the dashboard
- Your actor names show up in the sidebar
- The engine begins routing traffic to your runner
Environment Variables
RIVET_ENGINE
The endpoint of your Rivet Engine instance.
RIVET_NAMESPACE
The namespace to run actors in. Useful for multi-tenant deployments.
RIVET_RUNNER
A name for the runner to allow filtering which nodes to run actors on.
RIVET_RUNNER_KEY
A unique key for the runner. If another runner connects with the same key, the previous one is disconnected. This is useful for handling zombie runners that weren't shut down gracefully.
Generate a unique runner key using: uuidgen
or openssl rand -hex 16
Connection Examples
Testing Setup
You do not need the engine for local development, but it can be helpful for testing your production-readiness: