Skip to main content
By the end of this guide, your monitoring repository has one folder per service, shared defaults in a single config, a group per service with its own locations and variables, and a workflow that redeploys monitoring on every merge to main.
The Checkly check list filtered to Shop, showing the Shop API and Shop web groups with two checks each, tagged api and web
To follow along without your own app, clone the sample project. It monitors the Danube demo shop and its API.
To run this guide from your terminal or your coding agent, run npx checkly init in your project first. It installs the Checkly CLI and Checkly Skills for your agent. Then paste the prompt below into Claude Code, Cursor, Codex, or any agent that supports skills. It builds the same setup as this guide, proves it with npx checkly test --record, and stops for your confirmation before npx checkly deploy.
Prompt
The sections below are the same work done by hand, so you can see what the agent built and why each piece is there.

How a project is organized

Every Checkly project has three levels of configuration, and settings inherit downward. A value set on a check wins over the group, which wins over the project.
Tree of the sample project: the project sets frequency, two locations, a tag, and an alert channel. The Shop web group below it sets three locations and the Shop API group sets an API_BASE_URL variable. Of the three checks at the bottom, only Homepage uptime overrides a value, running every minute instead of the project's ten.
This is the sample project from this guide. Each box lists only what that level sets, and everything else comes from the level above. Groups are optional. A project with a handful of checks does fine with project defaults alone. Once several people own different parts of the system, a group per service gives each part its own settings and its own page in Checkly, and lets you run or mute that service as a unit. The folder layout is a convention, not a rule. Checkly finds check files with the checkMatch glob and does not care where they sit. Mirror the groups anyway, one folder per service, so the path tells you who owns a check and what it covers. Splitting by check type or by team works too, but service folders are the ones that survive a reorg.
Project layout
The rest of this guide sets up each level in turn, then wires up a deploy from CI.

Project defaults

Put the settings every check should inherit in checkly.config.ts, and the alert channel they share next to the checks.
checkly.config.ts
__checks__/alert-channels.ts
The checkMatch glob finds check files at any depth, so adding a service folder needs no config change. Keep logicalId stable. Changing it makes Checkly treat the project as new and drops its history.

A group per service

Each service folder gets a group.ts with a CheckGroupV2. The two groups here carry different things, which is the point: a group holds whatever is true for that service and nothing else. The storefront group sets locations. It runs from three regions so a regional CDN problem shows up as a single-location failure.
__checks__/web/group.ts
The API group sets a variable instead. Every API check in the folder reads {{API_BASE_URL}}, so moving the API to a new host is a one-line change.
__checks__/api/group.ts
Once deployed, each group gets its own page with the checks it owns, their combined availability, and a button to run them all at once.
The Shop web group page in Checkly showing two passing checks, availability and response time stats, and recent run results from three locations

Checks

A check joins its group through the group property and inherits everything above it. The file itself holds only what is specific to this check. The uptime monitor below overrides one inherited value, because a URL monitor is cheap enough to run every minute.
__checks__/web/uptime.check.ts
The API check reads the group’s variable in its URL and adds nothing but its own assertions.
__checks__/api/books.check.ts
Credentials go in secrets, not in code. Add one globally with npx checkly env add API_TOKEN "..." --secret and read it the same way, as {{API_TOKEN}} in API checks or process.env.API_TOKEN in scripts. See environment variables and secrets.
Run the project on Checkly’s infrastructure to confirm every check parses and passes.
Terminal
Terminal

Deploy from CI on every merge

The structure above is code, so it ships like code. Preview what the first deploy creates, then deploy once from your machine.
Terminal
Terminal
Terminal
From here on, let CI do it. The workflow below redeploys the project whenever a merge to main touches monitoring code. Checkly diffs the project against what is deployed and applies only the change, so re-running it is safe.
.github/workflows/checkly-deploy.yml
Store CHECKLY_API_KEY as a repository secret and CHECKLY_ACCOUNT_ID as a repository variable. Both come from your Checkly settings, described in CLI authentication. The --force flag skips the interactive confirmation.
This workflow deploys after a merge. Running npx checkly test on every pull request, so a broken check never reaches main, is the subject of the checks on every deploy guide.

Verify it works

Add a check the way a teammate would: one new file in the service folder, nothing else.
__checks__/api/book-detail.check.ts
The preview shows exactly one new resource. Everything else is untouched.
Terminal
Terminal
Commit the file and merge. The workflow deploys it, and the new check appears under Shop API with the group’s variable and the project’s alert channel already applied.

Next

Turn your Playwright tests into monitors: the tests you already have become the checks in your web folder.

Reference