Declarations

Declare variable names and the rules they must follow.

Usage

Save the file as Dotenvxfile in your project directory. It contains names and rules. Values stay in .env or your other environment sources.

Variable names are case-sensitive and must match [A-Za-z_][A-Za-z0-9_]*. Use single or double quotes. Comments begin with #. Blank lines are ignored.

# Dotenvxfile
strict true

env "DATABASE_URL", type: "url", required: true, storage: "encrypted", redacted: true
env 'SENTRY_DSN', optional: true

Variables are optional by default. The default type is "string", storage is "any", and redaction is off. Set rules explicitly or use root settings to change the defaults.

Options can continue on the next line after a comma:

env "PORT",
  type: "port",
  storage: "plaintext",
  redacted: false