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.
npx checkly test and transform it to production monitoring with npx checkly deploy.
Project Structure
Configure your Checkly project by creating and editing thecheckly.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:
__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.- Global Configuration
- Local Configuration
Your global Find a full reference of all project properties in the
checkly.config holds a set of defaults for your project.checkly.config.ts
Project configuration section.Logical IDs
Every construct requires a uniquelogicalId 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