For additional setup information, see CLI overview.
import { BrowserCheck, Frequency } from "checkly/constructs"import * as path from "path"new BrowserCheck("browser-check-1", { name: "Browser check #1", description: "Loads the **home page** and asserts key elements are visible.", frequency: Frequency.EVERY_10M, locations: ["us-east-1", "eu-west-1"], code: { entrypoint: path.join(__dirname, "home.spec.ts"), },})
import { BrowserCheck, Frequency } from "checkly/constructs"import * as path from "path"new BrowserCheck("advanced-browser-check", { name: "Advanced Browser Check", description: "Loads the **home page** and asserts key elements are visible.", activated: true, frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-west-1"], tags: ["e2e", "critical-path"], runtimeId: "2025.04", environmentVariables: [ { key: "TEST_USERNAME", value: "testuser" }, { key: "TEST_PASSWORD", value: "{{SECRET_PASSWORD}}", secret: true }, ], code: { entrypoint: path.join(__dirname, "advanced-flow.spec.ts"), },})
How often the Browser Check should run. Use the Frequency enum to set the check interval.Usage:
import { Frequency } from 'checkly/constructs'new BrowserCheck("my-check", { name: "My Browser Check", frequency: Frequency.EVERY_5M, /* More options... */})
Examples:
// For critical user journeysnew BrowserCheck("critical-login", { name: "Critical Login Flow", frequency: Frequency.EVERY_1M, // Every minute tags: ["critical", "high-priority"], /* More options... */})
// For regular monitoringnew BrowserCheck("standard-check", { name: "Standard User Flow", frequency: Frequency.EVERY_10M, // Every 10 minutes tags: ["monitoring"], /* More options... */})
The Checkly runtime version used to execute the Browser Check. Runtimes are managed execution environments for Browser and Multistep Checks. They include fixed Checkly-provided dependencies, such as Playwright, browser binaries, and runtime libraries.Use runtimeId for Browser Checks and Multistep Checks. For Playwright Check Suites, use engine instead to select the JavaScript engine version that runs your own Playwright project.Usage:
new BrowserCheck("my-check", { name: "My Browser Check", runtimeId: "2025.04", /* More options... */})
Array of public location codes where the Browser Check should run. Multiple locations provide geographic coverage and redundancy.Usage:
new BrowserCheck("my-check", { name: "My Browser Check", locations: ["us-east-1", "eu-west-1", "ap-southeast-1"], /* More options... */})
Examples:
// Comprehensive global monitoringnew BrowserCheck("global-check", { name: "Global User Experience", locations: [ "us-east-1", // N. Virginia "us-west-1", // N. California "eu-west-1", // Ireland "ap-southeast-1", // Singapore "ap-northeast-1", // Tokyo ], /* More options... */})
// Focus on specific regionsnew BrowserCheck("europe-check", { name: "European User Flow", locations: ["eu-west-1", "eu-central-1"], /* More options... */})
Use cases: Global user experience monitoring, regional performance testing, compliance requirements.
new BrowserCheck("purchase-flow-check", { name: "Purchase Flow", frequency: Frequency.EVERY_30M, locations: ["us-east-1", "eu-west-1"], tags: ["e2e", "critical", "revenue"], code: { entrypoint: path.join(__dirname, "purchase.spec.ts"), },})// purchase.spec.tsimport { test, expect } from "@playwright/test"test("user can complete purchase", async ({ page }) => { await page.goto("https://shop.example.com") // Add item to cart await page.getByTestId("product-1").click() await page.getByTestId("add-to-cart").click() // Go to checkout await page.getByTestId("cart-button").click() await page.getByTestId("checkout-button").click() // Fill checkout form await page.getByLabel("email").fill("test@example.com") await page.getByLabel("card-number").fill("4242424242424242") // Complete purchase await page.getByTestId("complete-purchase").click() await expect(page.getByTestId("success-message")).toBeVisible()})
new BrowserCheck("contact-form-check", { name: "Contact Form Submission", frequency: Frequency.EVERY_10M, code: { entrypoint: path.join(__dirname, "contact-form.spec.ts"), },})// contact-form.spec.tsimport { test, expect } from "@playwright/test"test("contact form works correctly", async ({ page }) => { await page.goto("https://example.com/contact") await page.getByLabel('name').fill("John Doe") await page.getByLabel('email').fill("john@example.com") await page.getByLabel('message').fill("This is a test message") await page.getByLabel('submit').click() await expect(page.getByText("Thank you")).toBeVisible()})
Browser checks require Playwright test files. Make sure your test files use the @playwright/test framework and follow Playwright’s testing conventions.