For information on creating and managing environment variables and secrets (including the difference between variables and secrets, inheritance, and where to set them), see the Environment Variables documentation.
Built-in variables available in Playwright Check Suites
Checkly sets the following environment variables on every Playwright Check Suite run:| Variable | Description |
|---|---|
CHECKLY | Set to 1 for all check runs executed by Checkly.Useful to distinguish Checkly runs from local runs. |
CHECKLY_RUN_SOURCE | Indicates how the check was triggered. Useful to customize the nature of your test depending on how it is run. See CHECKLY_RUN_SOURCE values below. |
CI | Set to 1 for CLI runs (npx checkly test or npx checkly trigger) and deployment-triggered checks. |
ACCOUNT_ID | The UUID of the Checkly account. |
CHECK_NAME | The name of the check. |
CHECKLY_CHECK_ID | The UUID of the check. |
CHECKLY_REGION | The region where the check was executed. |
CHECKLY_RUN_SOURCE values
| Value | Description |
|---|---|
CLI_DEPLOY | Used for the first run of Checks deployed using npx checkly deploy. |
DEPLOYMENT | Used for Check runs triggered as part of a CI/CD deployment. |
GROUP_RUN_ALL | Used for Check runs triggered from a Group’s edit screen, by clicking the “Run all checks” button. |
SCHEDULE_NOW | Used for Check runs triggered manually by clicking “Schedule now” in the webapp. |
SCHEDULER | Used for Check runs triggered as part of their regular schedule. |
TEST_NO_RECORD | Used for Check runs triggered by the npx checkly test CLI command. |
TEST_RECORD | Used for Check runs triggered by the npx checkly test --record or npx checkly pw-test CLI commands. |
TRIGGER_API | Used for Check runs triggered by the API. |
TRIGGER_NO_RECORD | Used for Check runs triggered by the npx checkly trigger CLI command. |
TRIGGER_RECORD | Used for Check runs triggered by the npx checkly trigger --record CLI command. |
Use built-in variables
Common ways to use Checkly’s built-in environment variables:Adjust behavior based on trigger type
Set different behavior for scheduled runs versus manual triggers:Configure Playwright based on environment
Adjust your Playwright configuration to always record traces on Checkly. In yourplaywright.config.ts, use the CHECKLY variable to identify it’s from Checkly.
playwright.config.ts