Runtime
Environment Variables
Environment variables allow you to configure your actors without changing code, enabling more flexible deployments.
Configuring Actor Behavior
Environment variables can be provided when creating an actor:
TypeScript
Example: Dynamic HTTP Server
Here's how you can use environment variables in your actor's code:
By changing the GREETING
environment variable, you can modify the server's response without changing code.
Default Environment Variables
Rivet provides the following default environment variables:
PORT_{NAME}
: The port number assigned to a named port (e.g.,PORT_HTTP
for a port named "http")
For more details about networking and ports, see Networking.