Join us for office hours !

Environment configuration

When developing a Probot App, you will need to have several different fields in a .env file which specify environment variables. Here are some common use cases:

Variable Description
APP_ID The App ID assigned to your GitHub App. Required

(Example: 1234)

Private key options One of the following is Required if there is no .pem file in your project's root directory
PRIVATE_KEY_PATH The path to the .pem file for your GitHub App.

(Example: path/to/key.pem)

PRIVATE_KEY The contents of the private key for your GitHub App. If you're unable to use multiline environment variables, use base64 encoding to convert the key to a single line string. See the Deployment docs for provider specific usage.
Webhook options
WEBHOOK_PROXY_URL Allows your local development environment to receive GitHub webhook events. Go to https://smee.io/new to get started.

(Example: https://smee.io/your-custom-url)

WEBHOOK_SECRET The webhook secret used when creating a GitHub App. 'development' is used as a default, but the value in .env needs to match the value configured in your App settings on GitHub. Note: GitHub marks this value as optional, but for optimal security it's required for Probot apps. Required

(Example: development)

For more on the set up of these items, check out Configuring a GitHub App.

Some less common environment variables are:

Variable Description
DISABLE_WEBHOOK_EVENT_CHECK Set to true to disable Probot's webhook-event-check feature. While the feature is enabled, Probot will warn you when your application is attempting to listen to an event that your GitHub App is not subscribed to.
Note: webhook-event-check is automatically disabled when NODE_ENV is set to production.

(Default: false)

GHE_HOST The hostname of your GitHub Enterprise instance.

(Example: github.mycompany.com)

GHE_PROTOCOL The protocol of your GitHub Enterprise instance. Defaults to HTTPS. Do not change unless you are certain.

(Example: https)

LOG_FORMAT By default, logs are formatted for readability in development. You can set this to json in order to disable the formatting
LOG_LEVEL The verbosity of logs to show when running your app, which can be fatal, error, warn, info, debug, trace or silent. Default: info
LOG_LEVEL_IN_STRING By default, when using the json format, the level printed in the log records is an int (10, 20, ..). This option tells the logger to print level as a string: {"level": "info"}. Default false
SENTRY_DSN Set to a Sentry DSN to report all errors thrown by your app.

(Example: https://1234abcd@sentry.io/12345)

PORT The port to start the local server on. Default: 3000
HOST The host to start the local server on.
WEBHOOK_PATH The URL path which will receive webhooks. Default: /
INSTALLATION_TOKEN_TTL The length of time installation access tokens are cached by Probot. This may be useful if your app is running long processes before accessing context.github. Default: 3540 (59 minutes)

(Example: 3300 or 55 minutes)

REDIS_URL Set to a redis:// url as connection option for ioredis in order to enable cluster support for request throttling.

(Example: redis://:secret@redis-123.redislabs.com:12345/0)

For more information on the formatting conventions and rules of .env files, check out the npm dotenv module's documentation.

Found a mistake or want to help improve this documentation? Suggest changes on GitHub

Get occasional updates on new apps & features.

Star

with by the Probot community

Code licensed ISC Docs licensed CC-BY-4.0