checkly test without deploying a project when you only need to validate an ephemeral environment, such as a pull request preview.
Choose an approach
A Checkly CLI project is a deployment boundary, not the same thing as a Git branch or application environment. Your pipeline decides which branch deploys which project.
Test an ephemeral environment
Pass runtime values tocheckly test with --env (-e) or --env-file. The values apply only to that test session and do not update your scheduled monitors.
Terminal
Continuously monitor multiple environments
The following example deploys one shared API check to development, staging, and production. Each deployment has:- A unique project identity and separate deployment history
- The same project-scoped check and group logical IDs
- Its own URL and secret API token
- Its own schedule, locations, and tags
Prerequisites
Prerequisites
- A Checkly account and a Checkly CLI project
CHECKLY_API_KEYandCHECKLY_ACCOUNT_IDconfigured in your CI provider- A persistent deployment URL and credentials for each environment
- A CI branch or deployment event that identifies the target environment
1
Define a stable project identity for each environment
Read the target environment from your CI pipeline and map it to a unique project Keep each project
logicalId.checkly.config.ts
logicalId stable. Changing it creates a different project instead of updating the existing environment’s monitors.2
Store environment-specific runtime values with the checks
Define values on a check or group when scheduled runs need them. In this example, the CLI reads the values from CI while deploying and stores them on the environment’s check group.The
__checks__/api.check.ts
application and api-health logical IDs can stay the same because resource logical IDs are scoped to their CLI project. Setting secret: true prevents Checkly from exposing the token after it is saved.3
Deploy the project that matches the application environment
Map each persistent application environment to one Checkly project in your pipeline. Run the matching command after that environment’s application deployment succeeds.The production job uses the same source files but supplies production values:Review the deployment changes before confirming them. After you have verified the mapping, a non-interactive CI job can use
For example, the staging deployment job would run:
Terminal
Terminal
--force to skip the confirmation prompt.Run different checks in each environment
When an environment needs additional or different checks, keep shared checks in one directory and select the environment-specific directory from your configuration:checkly.config.ts
__checks__/shared/ can contain health and login checks, while __checks__/production/ contains production-only purchase checks. Each environment remains authoritative for its own deployed project.
Understand environment variable behavior
Prefer check- or group-level variables when the same key needs a different value in each environment. A global
ENVIRONMENT_URL, for example, can hold only one account-wide value and is therefore not a good fit for separate development, staging, and production targets.
Use secrets for credentials, tokens, and other sensitive values. For more detail about build-time and runtime values, see CLI environment variables and environment variables and secrets.
Playwright Check Suites
For Playwright Check Suites, keep URLs and credentials in runtime environment variables and read them fromprocess.env in your Playwright configuration or fixtures. The project-per-environment model remains the same.
See environment-aware Playwright tests for configuring baseURL, fixtures, and local-versus-Checkly execution.