Enviroment Variables
Environment variables
Environment variables are key-value pairs configured outside your source code so that each value can change depending on the Environment.
Your source code can read these values to change behavior during the Build Step or during Function execution.
Any change you make to environment variables are not applied to previous deployments, they only apply to new deployments.
Creating environment variables
Environment variables can be declared only at the project level.
Declare an Environment Variable
To declare an Environment Variable for your deployment:
- From your dashboard, select your project.
- Select the Settings tab.
- Go to the Environment Variables section of your Project Settings.
- Enter the desired Name for your Environment Variable. For example, if you are using React and you create an Environment Variable named
REACT_APP_API_URL, it will be available underprocess.env.REACT_APP_API_URLin your code. - Then, enter the Value for your Environment Variable.
- Click Save and Deploy or just Save.
- You can also add Environment Variable at project creation.
Framework Prefixes
Most modern frameworks only expose variables to the browser if they have a specific prefix. Ensure your keys follow your framework's rules:
- Vite: VITE_API_URL
- React (CRA): REACT_APP_API_URL
- Vue CLI: VUE_APP_API_URL
- SvelteKit: PUBLIC_API_URL
Security Warning
Never store sensitive secrets (like private Database Passwords or Secret API Keys) in Lynfera environment variables. Because these are bundled into the frontend, anyone can view them by inspecting your site's source code in the browser.
User-Configurable Environment Variables
Lynfera allows you to define environment variables that customize how your service is built and deployed.
These variables are injected into the build container at build time and can be used to control build behavior, feature flags, or environment-specific settings.
| Variable | Value / Purpose |
|---|---|
| LYNFERA_SETTING_SKIP_INSTALL | Set to true to skip the dependency installation step. Useful when deploying prebuilt assets or static files that don’t require package installation. |
| LYNFERA_SETTING_SKIP_BUILD | Set to true to skip the build step. When combined with SKIP_INSTALL, Lynfera directly uploads the provided files without running any build commands. |
| LYNFERA_SETTING_SKIP_DECOR_LOGS | Set to true to disable decorative or non-essential logs, producing cleaner and more minimal build output. |
| LYNFERA_SETTING_INSTALL_RETRIES | Number of times dependency installation should be retried on failure. Defaults to 3. Each retry uses more permissive flags (such as legacy or force options) to improve install reliability. |
| LYNFERA_SETTING_FRAMEWORK | Manually specify the framework for the project. Overrides automatic framework detection and allows Lynfera to apply the correct build configuration earlier in the process. |
| LYNFERA_PREVENT_DEPLOYMENT_AUTO_PROMOTION | Set to true to disable automatic promotion of a successful deployment. This allows manual review or staged releases before making the deployment live. |
System Environment Variables
Lynfera automatically injects these variables into every build container. You can use them to customize your app based on the deployment environment.
| Variable | Value / Purpose |
|---|---|
| CI | Set to true to prevent interactive prompts during build. |
| NODE_ENV | Always set to production. |
| LYNFERA_BUILD_ID | Build / Deployment Id. |
| LYNFERA_GIT_COMMIT_SHA | Git commit hash value. |
| LYNFERA_GIT_BRANCH | Git branch from which code deployed. |
| LYNFERA_PUBLIC_ID | Public Id of each Deployment. |
| LYNFERA_PROJECT_ID | Project Id. |
| LYNFERA_PROJECT_URL | Project accesible url. Requires new deployment when subdomain changes |
| LYNFERA_DEPLOYMENT_URL | Project and specific deployment access url. Can change when subdomain changes |
| NODE_VERSION | Default Value 22 |