mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-10 17:26:17 +00:00
907 B
907 B
Error Reporting API
What it does
Accepts structured error reports and forwards them to Discord in a clean format. Submissions require a shared secret header so random users cannot spam your webhook.
How to use
- Set
DISCORD_WEBHOOK_URLandERROR_REPORT_TOKENin your environment (e.g., Vercel project settings → Environment Variables). - Send a POST request to
/api/report-errorwith headerx-error-report-token: <your token>and JSON that includes at leasterror. - Optional fields:
summary,type,metadata(object),environment(string or object withname).
Example
curl -X POST https://your-deployment.vercel.app/api/report-error \
-H "Content-Type: application/json" \
-H "x-error-report-token: YOUR_TOKEN" \
-d '{"error":"Search job failed","type":"search","metadata":{"account":"user@contoso.com"}}'