Webhooks

Trigger Bug0 tests automatically from hosting providers and other services using webhooks.

Overview

Webhooks allow external services to trigger Bug0 tests when:

Supported Integrations

Bug0 has built-in integrations for:

For other services, use the generic webhook endpoint.

Vercel Integration

Automatic Setup

  1. Go to Project SettingsIntegrations
  2. Click Connect under Vercel
  3. Authorize Bug0 to access your Vercel projects
  4. Select which Vercel project to connect

Once connected, tests run automatically when:

What Gets Passed

Bug0 receives from Vercel:

Configuration

In project settings, you can configure:

Netlify Integration

Automatic Setup

  1. Go to Project SettingsIntegrations
  2. Click Connect under Netlify
  3. Follow Netlify authorization flow
  4. Select which Netlify site to connect

Deploy Notifications

Bug0 listens for Netlify deploy notifications:

Generic Webhook

For other CI/CD systems, call the API directly:

POST https://app.bug0.com/api/run-tests
Content-Type: application/json
x-api-key: YOUR_API_KEY

{
  "projectId": "your-project-id",
  "url": "https://your-preview-url.com",
  "gitCommitSha": "abc123",
  "gitBranch": "feature/xyz",
  "prNumber": "42"
}

Request Parameters

ParameterRequiredDescription
projectIdYesYour Bug0 project ID
urlNoURL to test (overrides project base URL)
gitCommitShaNoGit commit SHA for status updates
gitBranchNoBranch name
prNumberNoPR number for comments
ownerNoGitHub repository owner
repoNoGitHub repository name

Custom Integrations

CircleCI

# .circleci/config.yml
jobs:
  e2e-tests:
    docker:
      - image: cimg/base:current
    steps:
      - run:
          name: Trigger Bug0 Tests
          command: |
            curl -X POST https://app.bug0.com/api/run-tests \
              -H "x-api-key: ${BUG0_API_KEY}" \
              -H "Content-Type: application/json" \
              -d '{
                "projectId": "'"${BUG0_PROJECT_ID}"'",
                "url": "'"${DEPLOY_URL}"'",
                "gitCommitSha": "'"${CIRCLE_SHA1}"'",
                "gitBranch": "'"${CIRCLE_BRANCH}"'"
              }'

GitLab CI

# .gitlab-ci.yml
e2e-tests:
  stage: test
  script:
    - |
      curl -X POST https://app.bug0.com/api/run-tests \
        -H "x-api-key: ${BUG0_API_KEY}" \
        -H "Content-Type: application/json" \
        -d '{
          "projectId": "'"${BUG0_PROJECT_ID}"'",
          "url": "'"${CI_ENVIRONMENT_URL}"'",
          "gitCommitSha": "'"${CI_COMMIT_SHA}"'",
          "gitBranch": "'"${CI_COMMIT_REF_NAME}"'"
        }'

Jenkins

// Jenkinsfile
pipeline {
    stages {
        stage('E2E Tests') {
            steps {
                sh '''
                    curl -X POST https://app.bug0.com/api/run-tests \
                        -H "x-api-key: ${BUG0_API_KEY}" \
                        -H "Content-Type: application/json" \
                        -d '{
                            "projectId": "'"${BUG0_PROJECT_ID}"'",
                            "url": "'"${DEPLOY_URL}"'",
                            "gitCommitSha": "'"${GIT_COMMIT}"'",
                            "gitBranch": "'"${GIT_BRANCH}"'"
                        }'
                '''
            }
        }
    }
}

AWS CodePipeline

Use a Lambda function or CodeBuild step:

aws lambda invoke \
  --function-name trigger-bug0-tests \
  --payload '{"url": "'"$DEPLOY_URL"'"}' \
  response.json

Webhook Security

API Key Authentication

Always use API keys in the x-api-key header:

-H "x-api-key: YOUR_API_KEY"

IP Allowlisting

Contact support if you need IP-based restrictions.

Rate Limiting

Webhooks are rate-limited to prevent abuse:

Rate limits are per-project. Contact support if you need higher limits.

Troubleshooting

Webhook Not Triggering Tests

  1. Check API key is valid
  2. Verify project ID is correct
  3. Check rate limits
  4. Review request payload format

Tests Running on Wrong URL

  1. Verify url parameter is correct
  2. Check for URL encoding issues
  3. Ensure URL is accessible from the internet

No Status Updates

  1. Verify GitHub integration is connected
  2. Check git parameters (sha, branch, PR) are passed
  3. Verify repository permissions