Skip to content
Press.js Press.js Press.js Docs

Environment Variables

All Playwright browser options can be set via PRESSJS_PLAYWRIGHT_* environment variables. These are merged with options from press.toml, with environment variables taking precedence.

VariableMaps toExample
PRESSJS_PLAYWRIGHT_MODEmode"launch", "connect", "cdp"
PRESSJS_PLAYWRIGHT_CHANNELchannel"chrome", "msedge"
PRESSJS_PLAYWRIGHT_EXECUTABLE_PATHexecutablePath"/usr/bin/chromium"
PRESSJS_PLAYWRIGHT_HEADLESSheadless"true", "false"
PRESSJS_PLAYWRIGHT_ARGSargsSpace-separated or JSON array ("--disable-gpu --no-sandbox" or '["--disable-gpu"]')
PRESSJS_PLAYWRIGHT_TIMEOUT_MStimeoutMs"30000"
PRESSJS_PLAYWRIGHT_SLOW_MOslowMo"100"
PRESSJS_PLAYWRIGHT_WS_ENDPOINTwsEndpoint"ws://localhost:9222/..."
PRESSJS_PLAYWRIGHT_ENDPOINT_URLendpointURL"http://localhost:9222"
PRESSJS_PLAYWRIGHT_EXPOSE_NETWORKexposeNetwork"*"
PRESSJS_PLAYWRIGHT_HEADERSheadersJSON object string ('{"Authorization":"Bearer ..."}')
VariableDescription
PRESSJS_RENDER_DEBUGWhen set to a truthy value ("1", "true", "yes", "on"), preserves render debug logs from Press.js Cloud that are normally suppressed.
PRESSJS_DEVICE_SCALE_FACTOROverride the device scale factor for the rendering viewport. Default is 2, maximum is 4. Higher values produce sharper output at the cost of larger PDF files.

Local runtime secrets are configured in press.toml by mapping the page-facing secret name to a source environment variable:

[runtime.secrets]
API_TOKEN = "PRESS_API_TOKEN"

For press render, the CLI reads .dev.vars from the selected entry workspace and then overlays the current process environment. Process environment variables take precedence. Secret values are exposed during rendering through pressCloud.secrets and https://p.press.internal/environment.json.

.dev.vars
PRESS_API_TOKEN=dev-token

press render --remote does not forward local runtime env/secrets or .dev.vars values. Remote renders use the environment and secrets configured on the Cloud deploy.

Cloud authentication and connection variables:

VariableDescription
PRESS_CLOUD_TOKENAPI key for automated cloud authentication (prefix pcak_). Bypasses interactive login.
PRESS_CLOUD_API_BASEOverride the Press.js Cloud API base URL.

Cloud CLI installation variables:

VariableDescription
PRESSJS_CLOUD_INSTALL_DIRDirectory where the Press.js Cloud CLI binary is installed. Defaults to ~/.press-js/cloud.
PRESSJS_CLOUD_CLI_PATHDirect path to a press-cloud-cli binary. Bypasses install directory lookup.
PRESS_CLOUD_CLI_DOWNLOAD_URLCustom cloud CLI archive or binary URL. Overrides the default GitHub latest release lookup.

Automatic update settings are stored in ~/.press-js/settings.json. Use press update config --auto true|false to change the setting.