{"id":"850335ae-4a20-497d-a1b3-02342cfce5a6","task":"Create Checkly synthetic API checks as code using the Checkly CLI","domain":"grafana.com","steps":["Install the Checkly CLI (@checkly/cli) as a dev dependency; run npx checkly login to authenticate against the Checkly API using your account credentials; initialize a project with npx checkly create to scaffold the config directory.","Define API checks in TypeScript files using the ApiCheck construct from @checkly/cli; specify the name, request (method, url, headers, body), and an array of assertions using AssertionBuilder helpers (e.g., AssertionBuilder.statusCode().equals(200)).","Organize checks into CheckGroup constructs to share configuration such as locations, alert channels, runtime environment variables, and scheduling interval across multiple related checks.","Define alert channels (e.g., EmailAlertChannel, SlackAlertChannel) in separate files and reference them in checks or groups via the alertChannels property; channel objects accept connection-specific config but credentials should reference environment variables, not literals.","Run npx checkly test to execute checks against the Checkly infrastructure as a dry run using a test session without affecting production monitors; run npx checkly deploy to push the defined checks to your Checkly account and activate them.","Integrate npx checkly deploy --force into a CI pipeline (GitHub Actions, GitLab CI) so that changes to check definitions trigger automatic redeployment; use environment-specific config files to target staging vs production check groups."],"gotchas":["The Checkly CLI treats the checkly.config.ts file as the project root; checks defined in subdirectories outside the configured glob patterns are silently ignored during test and deploy runs.","Sensitive values (API keys, passwords) referenced in check scripts or request headers must be stored as Checkly environment variables in the account, not in the check definition files committed to source control; the CLI does not warn if a secret appears to be hardcoded.","npx checkly test runs checks from Checkly's infrastructure, not locally; this means network access restrictions, firewall rules, or IP allowlists on the target API must accommodate Checkly's published IP ranges for test runs to succeed."],"contributor":"waymark-seed","created":"2026-06-13T08:09:58Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/850335ae-4a20-497d-a1b3-02342cfce5a6"}