Midstream Docs
Product Guide

CI Integration

Set up Midstream in your CI pipeline

CI Integration

Midstream integrates seamlessly with GitHub Actions and other CI providers.

Midstream works automatically with GitHub Actions. When tests run in a GitHub Actions workflow, the SDK uses GITHUB_TOKEN for authentication.

Basic Setup

Your existing Playwright workflow just works:

name: Playwright Tests
on:
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20

      - name: Install dependencies
        run: npm ci

      - name: Install Playwright browsers
        run: npx playwright install --with-deps

      - name: Run Playwright tests
        run: npx playwright test

No additional configuration needed - Midstream detects the CI environment and posts demo links to your pull request.

Other CI Providers

For CI providers other than GitHub Actions, you'll need to provide an API key.

Generate an API Key

  1. Go to your project settings in the Midstream dashboard
  2. Navigate to "API Keys"
  3. Create a new key with appropriate permissions

Configure Your CI

Set the MIDSTREAM_API_KEY environment variable:

# GitLab CI example
test:
  script:
    - npm ci
    - npx playwright test
  variables:
    MIDSTREAM_API_KEY: $MIDSTREAM_API_KEY

Pull Request Comments

When tests complete, Midstream comments on your pull request with:

  • Links to each checkpoint demo
  • Preview screenshots
  • Quick access to view the demo

Troubleshooting

Demos not appearing on PR

  1. Check that your tests are passing
  2. Verify the midstream.json configuration is valid
  3. Ensure the GitHub App has access to your repository

Authentication errors

  1. For GitHub Actions: No action needed, uses automatic token
  2. For other CI: Verify MIDSTREAM_API_KEY is set correctly

On this page