Minimal Documentation Lynfera

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 under process.env.REACT_APP_API_URL in 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.

VariableValue / Purpose
LYNFERA_SETTING_SKIP_INSTALLSet 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_BUILDSet 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_LOGSSet to true to disable decorative or non-essential logs, producing cleaner and more minimal build output.
LYNFERA_SETTING_INSTALL_RETRIESNumber 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_FRAMEWORKManually 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_PROMOTIONSet 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.

VariableValue / Purpose
CISet to true to prevent interactive prompts during build.
NODE_ENVAlways set to production.
LYNFERA_BUILD_IDBuild / Deployment Id.
LYNFERA_GIT_COMMIT_SHAGit commit hash value.
LYNFERA_GIT_BRANCHGit branch from which code deployed.
LYNFERA_PUBLIC_IDPublic Id of each Deployment.
LYNFERA_PROJECT_IDProject Id.
LYNFERA_PROJECT_URLProject accesible url. Requires new deployment when subdomain changes
LYNFERA_DEPLOYMENT_URLProject and specific deployment access url. Can change when subdomain changes
NODE_VERSIONDefault Value 22

Enjoying the docs? If our platform has been helpful, consider giving us a ⭐ on GitHub — it is really appreciated!

⭐ Star us on GitHub