Dynamic secret scrubbing allows you to retrieve secrets at runtime from external vaults (like Azure Key Vault, AWS Secrets Manager, or HashiCorp Vault) while automatically removing those sensitive values from logs, traces, screenshots with text, and report trees.This is particularly useful for organizations that prefer not to store secrets in Checkly and want to maintain their existing secret management infrastructure.Set environment variables with the CHECKLY_SECRET_* prefix and the runtime will detect and scrub those values from all check results.
Pattern-based detection: Scrubbing works by detecting code and output structures. Complex or unconventional Playwright usage may fall outside of this detection. Follow the documented patterns for reliable scrubbing.
// This works ✅const apiKey = process.env.CHECKLY_SECRET_API_KEY// This doesn't work ❌const key = 'CHECKLY_SECRET_' + 'API_KEY'const apiKey = process.env[key]
import { test } from '@playwright/test'test('API call with scrubbed credentials', async ({ page }) => { // Set secrets at runtime process.env.CHECKLY_SECRET_API_TOKEN = await getTokenFromVault() process.env.CHECKLY_SECRET_USER_ID = await getCurrentUserId() // Use in your test - values will be scrubbed from results await page.request.post('/api/data', { headers: { 'Authorization': `Bearer ${process.env.CHECKLY_SECRET_API_TOKEN}`, 'X-User-ID': process.env.CHECKLY_SECRET_USER_ID } })})