Skip to content
Merged
8 changes: 4 additions & 4 deletions cli/checkly-login.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ If you already have an account:

After successful login, the CLI stores authentication tokens locally in:

- **macOS**: `~/Library/Preferences/@checkly/cli-nodejs/auth.json`
- **Linux**: ` ~/.config/@checkly/cli-nodejs/auth.json`
- **Windows**: `%APPDATA%\@checkly\cli-nodejs\auth.json`
- **macOS**: `~/Library/Preferences/@checkly/cli/auth.json`
- **Linux**: `~/.config/@checkly/cli/auth.json`
- **Windows**: `%APPDATA%\@checkly\cli\Config\auth.json`

These tokens are encrypted and used for subsequent CLI operations without requiring re-authentication.
The file is plain JSON and is not encrypted. The stored tokens are used for subsequent CLI operations without requiring re-authentication.

## Troubleshooting

Expand Down
8 changes: 5 additions & 3 deletions cli/checkly-logout.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ The logout process will:

The command removes authentication tokens stored locally in:

- **macOS**: `~/Library/Preferences/@checkly/cli-nodejs/auth.json`
- **Linux**: `~/.config/@checkly/cli-nodejs/auth.json`
- **Windows**: `%APPDATA%\@checkly\cli-nodejs\auth.json`
- **macOS**: `~/Library/Preferences/@checkly/cli/auth.json`
- **Linux**: `~/.config/@checkly/cli/auth.json`
- **Windows**: `%APPDATA%\@checkly\cli\Config\auth.json`

The same directory holds a `config.json` with the selected account ID and name, which is cleared as well.

## After Logout

Expand Down
3 changes: 2 additions & 1 deletion cli/checkly-pw-test.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ Running this command:

Adds a new Playwright Check Suite to your `checkly.config.ts`:

```typescript checkly.config.ts highlight={8-15}
```typescript checkly.config.ts highlight={9-16}
import { defineConfig } from 'checkly'
const config = defineConfig({
projectName: "Playwright Project",
logicalId: "playwright-project",
Expand Down
7 changes: 4 additions & 3 deletions cli/environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ new ApiCheck('books-api-check-1', {
entrypoint: path.join(__dirname, './utils/setup.ts'),
},
request: {
url: '{{ENVIRONMENT_URL}}' || 'https://danube-web.shop/api/books',
url: '{{ENVIRONMENT_URL}}',
method: 'GET',
followRedirects: true,
skipSSL: false,
Expand All @@ -114,8 +114,9 @@ npx checkly test -e ENVIRONMENT_URL="https://staging.checklyhq.com"

- Notice that we pass in the variable using the `-e` flag. This means it will be passed to the cloud environment and made
available during runtime.
- After deploying this check, the `ENVIRONMENT_URL` needs to be set at the Account, Group or Check level. If not set, the Check
will use the fallback URL.
- After deploying this check, the `ENVIRONMENT_URL` needs to be set at the Account, Group or Check level. Handlebars variables have no
fallback, so the check will not work until the variable is set. Only script code, like the Playwright example above, can
provide a fallback value.
- Prepending the variable like `ENVIRONMENT_URL="https://staging.checklyhq.com" npx checkly test` has no effect as local
environment variables are not replaced in code dependencies.

Expand Down
4 changes: 2 additions & 2 deletions concepts/environments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The following example deploys one shared API check to development, staging, and
Read the target environment from your CI pipeline and map it to a unique project `logicalId`.

```typescript checkly.config.ts
import { defineConfig } from "checkly"
import { defineConfig, type Region } from "checkly"
import { Frequency } from "checkly/constructs"

type Environment = "development" | "staging" | "production"
Expand All @@ -63,7 +63,7 @@ The following example deploys one shared API check to development, staging, and
projectName: string
logicalId: string
frequency: Frequency
locations: string[]
locations: (keyof Region)[]
}> = {
development: {
projectName: "My app - Development",
Expand Down
8 changes: 4 additions & 4 deletions constructs/dynamic-monitor-creation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This page shows a few examples.
Iterating through lists of target URLs is an easy way to manage checks at scale while avoiding code duplication.

```ts __checks__/api.check.ts
import { ApiCheck } from 'checkly/constructs'
import { ApiCheck, AssertionBuilder } from 'checkly/constructs'

const publicResources = ['/public-stats', '/v1/runtimes']

Expand All @@ -25,7 +25,7 @@ for (const publicResource of publicResources) {
url: `https://api.checkly.com${publicResource}`,
method: 'GET',
followRedirects: true,
skipSsl: false,
skipSSL: false,
assertions: [ AssertionBuilder.statusCode().equals(200) ]
}
})
Expand All @@ -35,7 +35,7 @@ for (const publicResource of publicResources) {
Asynchronous operations are supported by exporting an async function from your check files, too.

```ts __checks__/api.check.ts
import { ApiCheck } from 'checkly/constructs'
import { ApiCheck, AssertionBuilder } from 'checkly/constructs'
import { getPublicResources } from './helpers'

// an exported async function to signal that
Expand All @@ -50,7 +50,7 @@ export default async function createApiChecks() {
url: `https://api.checkly.com${publicResource}`,
method: 'GET',
followRedirects: true,
skipSsl: false,
skipSSL: false,
assertions: [ AssertionBuilder.statusCode().equals(200) ]
}
})
Expand Down
10 changes: 9 additions & 1 deletion constructs/heartbeat-monitor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@ new HeartbeatMonitor("daily-backup-heartbeat", {
```

```ts Advanced Example
import { HeartbeatMonitor } from "checkly/constructs"
import { HeartbeatMonitor, EmailAlertChannel, SlackAppAlertChannel } from "checkly/constructs"

const emailChannel = new EmailAlertChannel("team-email", {
address: "team@example.com",
})

const slackChannel = new SlackAppAlertChannel("team-slack", {
slackChannels: ["#ops"]
})

new HeartbeatMonitor("newsletter-heartbeat", {
name: "Weekly Newsletter Job",
Expand Down
2 changes: 1 addition & 1 deletion constructs/url-monitor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ UrlAssertionBuilder.statusCode().equals(200)
```ts
UrlAssertionBuilder.statusCode().lessThan(300)
// Equivalent to:
{ source: 'STATUS_CODE', comparison: 'lessThan', target: '300' }
{ source: 'STATUS_CODE', comparison: 'LESS_THAN', target: '300' }
```

Learn more in our docs on [Assertions](/detect/assertions).
Expand Down
6 changes: 3 additions & 3 deletions detect/synthetic-monitoring/api-checks/api-structure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ new ApiCheck('user-api-health', {
request: {
method: 'GET',
url: 'https://api.example.com/v1/users/health',
headers: {
'Authorization': 'Bearer {{API_TOKEN}}'
},
headers: [
{ key: 'Authorization', value: 'Bearer {{API_TOKEN}}' }
],
assertions: [
AssertionBuilder.statusCode().equals(200),
AssertionBuilder.responseTime().lessThan(2000),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Your folder structure:
The API check performs a `GET` on an authenticated endpoint:

```ts api.check.ts
import { ApiCheck } from '@checkly/cli/constructs'
import { ApiCheck } from 'checkly/constructs'
import * as path from 'path'

new ApiCheck('api-check-1', {
Expand Down
14 changes: 8 additions & 6 deletions detect/synthetic-monitoring/playwright-checks/add-to-group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ Learn more about [using groups](/constructs/check-group-v2).

Import the group and reference it in your Playwright Check Suite configuration:

```typescript checkly.config.ts highlight={2,14}
```typescript checkly.config.ts highlight={3,17}
import { defineConfig } from 'checkly'
import { Frequency } from 'checkly/constructs'
import { myGroup } from './website-group.check'

export default defineConfig({
Expand All @@ -54,7 +55,7 @@ export default defineConfig({
name: 'Critical Tests',
logicalId: 'critical-tests',
pwTags:'critical',
frequency: 10,
frequency: Frequency.EVERY_10M,
locations: ['us-east-1',],
group: myGroup,
},
Expand All @@ -76,8 +77,9 @@ Your Playwright Check Suite now appears in the group in your [Checkly Home Dashb

Add multiple Playwright Check Suites to the same group while keeping individual test selection and frequency settings. Reference the group in each suite:

```typescript checkly.config.ts highlight={2,13,20,27}
```typescript checkly.config.ts highlight={3,16,23,30}
import { defineConfig } from 'checkly'
import { Frequency } from 'checkly/constructs'
import { myGroup } from './website-group.check'

export default defineConfig({
Expand All @@ -90,21 +92,21 @@ export default defineConfig({
name: 'Critical User Flows',
logicalId: 'critical-flows',
pwTags: 'critical',
frequency: 5,
frequency: Frequency.EVERY_5M,
group: myGroup,
},
{
name: 'Authentication Tests',
logicalId: 'auth-tests',
pwTags: 'auth',
frequency: 10,
frequency: Frequency.EVERY_10M,
group: myGroup,
},
{
name: 'Checkout Flow',
logicalId: 'checkout-flow',
pwTags: 'checkout',
frequency: 5,
frequency: Frequency.EVERY_5M,
group: myGroup,
},
],
Expand Down
19 changes: 9 additions & 10 deletions detect/testing/creating-your-first-test.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ my-checkly-project/

Open `checkly.config.ts` to configure your monitoring setup:

```ts Checkly.config.ts
import { defineConfig } from '@checkly/cli'
```ts checkly.config.ts
import { defineConfig } from 'checkly'
import { Frequency } from 'checkly/constructs'

export default defineConfig({
projectName: 'My First Checkly Project',
Expand All @@ -66,13 +67,13 @@ export default defineConfig({
activated: true,
muted: false,
runtimeId: '2025.04',
frequency: 5, // Run every 5 minutes
frequency: Frequency.EVERY_5M,
locations: ['us-east-1', 'eu-west-1'], // Global locations
tags: ['production', 'critical'],

// Browser check specific settings
browserChecks: {
frequency: 10, // Browser checks every 10 minutes
frequency: Frequency.EVERY_10M,
testMatch: '**/__checks__/*.spec.ts',
},
},
Expand Down Expand Up @@ -146,9 +147,8 @@ After deployment, you can:

For more control over your browser checks:

```ts Checkly.config.ts
// __checks__/advanced-browser.check.ts
import { BrowserCheck, Frequency } from '@checkly/cli/constructs'
```ts __checks__/advanced-browser.check.ts
import { BrowserCheck, Frequency, RetryStrategyBuilder } from 'checkly/constructs'

new BrowserCheck('advanced-check', {
name: 'Advanced Browser Check',
Expand All @@ -159,11 +159,10 @@ new BrowserCheck('advanced-check', {
code: {
entrypoint: './advanced-test.spec.ts',
},
retryStrategy: {
type: 'linear',
retryStrategy: RetryStrategyBuilder.linearStrategy({
baseBackoffSeconds: 60,
maxRetries: 2,
},
}),
})
```

Expand Down
Loading
Loading