Bridge is in a state of development and is not stable.
RAGE:MP to FiveM Bridge
Plugins

env-loader

env-loader

env-loader is a server-side plugin that loads each resource's .env file at startup and exposes mp.environment.loadEnv().

Keep secrets private

Never commit license keys, database URLs, tokens, or passwords. Keep .env files out of git and avoid exposing them to client or NUI code.

Side

Server only

API

mp.environment.loadEnv()

Disable name

env-loader

Add a .env file

Create a .env file in your resource folder.

Put secrets and environment-specific config inside it.

Read values from process.env after the bridge starts.

your-gamemode/.env
DATABASE_URL=mysql://user:password@localhost:3306/gamemode
JWT_SECRET=change-me
ECONOMY_DEBUG=false
server/index.js
const databaseUrl = process.env.DATABASE_URL;

if (!databaseUrl) {
  throw new Error('DATABASE_URL is missing');
}

Manual reload

Use mp.environment.loadEnv() when you need to explicitly load environment variables from code.

server/config.js
mp.environment.loadEnv();

export const config = {
  databaseUrl: process.env.DATABASE_URL,
  debugEconomy: process.env.ECONOMY_DEBUG === 'true',
};

Disable it

your-gamemode/fxmanifest.lua
disable_plugin 'env-loader'
ragemp-fivem-bridge/fxmanifest.lua
disable_plugin 'env-loader'

On this page