Configuration and Integration

Environment Variables

Learn how to use environment variables to manage configuration settings in your apps.

Environment variables are key-value pairs that are used to configure the behavior of your apps. Developers can set these variables on the settings page of their deployment environment, and the apps can access them during runtime.

Using Environment Variables

You can set environment variables in your app by going to the settings page and clicking on the “Environment Variables” tab. Here, you can view and edit the environment variables for your app.

In Node.js applications, you can access environment variables using the process.env object. Here’s an example:

1const apiKey = process.env.API_KEY
2const dbHost = process.env.DB_HOST
4console.log(`API Key: ${apiKey}`)
5console.log(`Database Host: ${dbHost}`)

Default Environment Variables

By default, the following environment variables are set for all apps:

  • MAVENAGI_APP_ID: The app ID.
  • MAVENAGI_APP_SECRET: A app secret used to authenticate requests to the API. This variable is set automatically when a new app is created. When you rotate the app secret, you can choose to set this variable to the new secret.

Clients initialized from the SDK automatically use the MAVENAGI_APP_ID and MAVENAGI_APP_SECRET environment variables to authenticate requests to the API if no credentials are provided explicitly.