A standalone error capture proxy deployed as a Vercel Serverless Function. Holds the GITHUB_TOKEN secret so your frontend apps never need to.
Or manually:
# 1. Clone or copy this directory
# 2. Install dependencies
npm install
# 3. Set environment variables
vercel env add GITHUB_TOKEN # paste your GitHub PAT
vercel env add GITHUB_REPO # e.g., myorg/myapp
# 4. Deploy
vercel deploy --prodSet these in the Vercel dashboard or via CLI:
| Variable | Required | Description |
|---|---|---|
GITHUB_TOKEN |
Yes | GitHub PAT with Issues read/write permission |
GITHUB_REPO |
Yes | Target repo in owner/repo format (e.g., myorg/myapp) |
ALLOWED_ORIGINS |
No | Comma-separated allowed origins (empty = allow all) |
ENVIRONMENT |
No | Environment name shown in issues (default: "production") |
See .env.example for a template.
Point your error boundaries at the deployed URL:
// In your error boundary (error.tsx)
fetch('https://your-proxy.vercel.app/api/capture', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
message: error.message,
stack: error.stack,
digest: error.digest,
url: window.location.href,
boundary: 'root',
}),
}).catch(() => {})GITHUB_TOKENis stored as a Vercel environment variable (encrypted, never in code)- Origin allowlist prevents unauthorized domains from reporting errors
- IP-based rate limiting (5 req/hour per IP)
- Payload validation rejects malformed requests
- CORS headers included for cross-origin browser requests