Skip to main content
Modelence provides flexible configuration options for your application. You can configure your app through the startApp() function, environment variables, and Modelence Cloud settings.

Configuration Methods

There are three ways to configure your Modelence application, listed in order of precedence:
  1. Environment Variables - Highest priority, overrides everything
  2. Modelence Cloud - Synced configuration from cloud.modelence.com
  3. startApp() Options - Direct code configuration, lowest priority
Environment variables always take precedence, allowing you to override any configuration when deploying to different environments.

Basic Configuration with startApp()

The startApp() function is your application’s entry point where you configure core settings:
src/server/app.ts

Environment Variables

Environment variables provide a way to configure your application without hardcoding values. They override all other configuration methods.

Core Environment Variables

.modelence.env

All Environment Variables

Every MODELENCE_* variable (plus the few non-prefixed ones) that the framework or first-party packages read. Anything not listed here is application-specific and should go through defineConfigs / getConfig instead.

Core

Modelence Cloud

Authentication (OAuth providers)

Email providers

Any variable not listed here is application-specific. Define it through your modules’ configSchema so Modelence Cloud can manage it and getConfig() can read it type-safely.

Modelence Cloud Configuration

On Modelence Cloud, the environment’s variables and its configSchema values reach the app when it starts, both when it is deployed and when it runs locally in a connected environment. See Environment Variables for what the platform provides and how variables are declared, and Local Setup for connecting a project on your machine.

Next Steps

Authentication

Configure authentication and user management

Email Setup

Set up email providers for transactional emails

Roles & Permissions

Define user roles and permissions

WebSockets

Enable real-time communication