Skip to main content

Overview

When running a NanoForge game (via nf start), environment variables can be passed to the client and server through a .env file at the root of the project, or directly from the environment.

Scoping by prefix

Variables are scoped by their prefix, which controls where they are available:
Prefixes are stripped before the variable is exposed to libraries. For example, NANOFORGE_CLIENT_SERVER_ADDRESS is exposed to the client as SERVER_ADDRESS.
For full documentation on how libraries consume these variables, see @nanoforge-dev/config.