Configuring Environments
- Getting Started complete
- staging and production histories visible and switchable in the dashboard’s environment picker.
The FK_ENV_* pattern
Section titled “The FK_ENV_* pattern”Set environment variables prefixed with FK_ENV_ before running tests. The reporter strips the prefix, lowercases the key, and attaches the rest as environment metadata.
export FK_ENV_DEPLOYMENT=stagingexport FK_ENV_REGION=us-east-1Results in environment metadata:
{ "deployment": "staging", "region": "us-east-1"}Runs with deployment=staging land in a separate history from runs with deployment=production.
Example: staging vs production
Section titled “Example: staging vs production”The example below uses GitHub Actions and Playwright Test. The general pattern applies to any CI/runner.
jobs: test: runs-on: ubuntu-latest permissions: contents: read id-token: write strategy: matrix: deployment: [staging, production] env: FK_ENV_DEPLOYMENT: ${{ matrix.deployment }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 - run: npm ci - run: npx playwright testPush to the repo. On the project dashboard, open the environment picker (top-right) and select staging or production — each has its own commit history, flakiness stats, and PR checks.
What counts as an environment?
Section titled “What counts as an environment?”Flakiness.io’s official reporters auto-collect some metadata so you don’t have to set it manually:
- Operating system — captured by every official reporter.
- Runner-specific detail — e.g.
@flakiness/playwrightcan capture browser version when enabled.
Use FK_ENV_* for everything else: deployment target, database backend, region, feature flag, etc.