Webhooks
Trigger Bug0 tests automatically from hosting providers and other services using webhooks.
Overview
Webhooks allow external services to trigger Bug0 tests when:
- A deployment completes
- A preview URL is ready
- Custom events occur
Supported Integrations
Bug0 has built-in integrations for:
- Vercel - Automatic trigger on deployments
- Netlify - Automatic trigger on deployments
For other services, use the generic webhook endpoint.
Vercel Integration
Automatic Setup
- Go to Project Settings → Integrations
- Click Connect under Vercel
- Authorize Bug0 to access your Vercel projects
- Select which Vercel project to connect
Once connected, tests run automatically when:
- Preview deployments complete
- Production deployments complete
What Gets Passed
Bug0 receives from Vercel:
- Deployment URL
- Git commit SHA
- Branch name
- PR number (if applicable)
Configuration
In project settings, you can configure:
- Run on preview deployments only
- Run on production deployments
- Skip certain branches
Netlify Integration
Automatic Setup
- Go to Project Settings → Integrations
- Click Connect under Netlify
- Follow Netlify authorization flow
- Select which Netlify site to connect
Deploy Notifications
Bug0 listens for Netlify deploy notifications:
- Deploy succeeded events
- Includes deploy URL and git info
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
| Parameter | Required | Description |
|---|---|---|
projectId | Yes | Your Bug0 project ID |
url | No | URL to test (overrides project base URL) |
gitCommitSha | No | Git commit SHA for status updates |
gitBranch | No | Branch name |
prNumber | No | PR number for comments |
owner | No | GitHub repository owner |
repo | No | GitHub 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:
- 10 requests per minute per project
- 100 requests per hour per project
Rate limits are per-project. Contact support if you need higher limits.
Troubleshooting
Webhook Not Triggering Tests
- Check API key is valid
- Verify project ID is correct
- Check rate limits
- Review request payload format
Tests Running on Wrong URL
- Verify
urlparameter is correct - Check for URL encoding issues
- Ensure URL is accessible from the internet
No Status Updates
- Verify GitHub integration is connected
- Check git parameters (sha, branch, PR) are passed
- Verify repository permissions