Skip to main content
Constructs are JavaScript/TypeScript classes that represent your all monitoring resources. Import them from checkly/constructs to create checks, alert channels, and other resources in code.
api.check.ts
The Checkly CLI supports JavaScript and TypeScript. The documentation focuses on TypeScript, because we recommend using TypeScript for a better developer experience.
Test this API check with npx checkly test and transform it to production monitoring with npx checkly deploy.

Project Structure

Configure your Checkly project by creating and editing the checkly.config.ts. The configuration file enables you to set default settings like monitoring locations, configure alert settings and organize your Checkly files to match your project requirements. Here is an example directory tree of what that would look like:
We recommend separating your monitoring resources from your application code using the __checks__ path convention. However, it’s up to you to define where your monitoring setup will be configured.

Project Configuration

As your project grows, you will want to override these defaults for specific checks or check groups. The recommended way to tackle this is using a mix of global and local configuration.
Your global checkly.config holds a set of defaults for your project.
checkly.config.ts
Find a full reference of all project properties in the Project configuration section.

Logical IDs

Every construct requires a unique logicalId as its first parameter. This ID tracks resources across deployments and updates. Key rules:
  • IDs must be unique within your project
  • Changing an ID creates a new resource and removes the old one
  • IDs can be any string up to 255 characters
api-check.ts

Programming with Constructs

Constructs are JavaScript/TypeScript classes that you can initialize programmatically. Use standard programming patterns:
api-check.ts

Next Steps

Each construct has detailed documentation with examples, configuration options, and best practices. Start with the construct type you need, and start configuring your monitoring infrastructure in code.