Cloudflare Worker that accepts feedback submissions from DA (Document Authoring) and EW (Experience Workspace) and forwards them to Slack via an incoming webhook.
- Wrangler CLI (
npm install -g wrangler) - A Slack app with an Incoming Webhook URL
npm installThe webhook URL is stored as a Cloudflare Worker secret — it is never committed to source control or placed in wrangler.toml.
# For the default (dev) environment:
wrangler secret put SLACK_WEBHOOK_URL
# For production:
wrangler secret put SLACK_WEBHOOK_URL --env productionPaste your Slack Incoming Webhook URL when prompted.
Edit wrangler.toml. The ALLOWED_ORIGINS var is a comma-separated list of exact origin strings (no wildcards):
[vars]
ALLOWED_ORIGINS = "localhost:3000"
[env.production.vars]
ALLOWED_ORIGINS = "da.live,adobe.com"The code automatically prepends https:// to bare hostnames, and http:// for localhost entries. If you need a full origin (e.g. a non-standard port on a remote host), you can still include the protocol explicitly — it will be used as-is.
npm run devThe worker starts at http://localhost:8787. To supply the Slack secret locally without committing it, create a .dev.vars file (already gitignored):
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/your/webhook/url
npm test # run once
npm run test:watch # watch mode# Production
npm run deployRequest headers:
Content-Type: application/jsonOrigin: <one of the configured allowed origins>
Request body:
{
"category": "general | feature-request | bug | question | other",
"message": "string, required, max 2000 chars",
"context": {
"org": "string, required",
"site": "string, required",
"path": "string, required"
},
"sessionId": "string, optional"
}Success: 200 { "ok": true }
Error responses:
| Status | Meaning |
|---|---|
| 400 | Validation failure — { "error": "description" } |
| 403 | Origin not in allowed list |
| 404 | Route or method not found |
| 502 | Slack delivery failed |
curl -X POST http://localhost:8787/feedback \
-H "Content-Type: application/json" \
-H "Origin: http://localhost:3000" \
-d '{
"category": "bug",
"message": "The publish button does not work when the path contains spaces.",
"context": {
"org": "myorg",
"site": "mysite",
"path": "/content/my-page"
},
"sessionId": "abc-123-optional"
}'Expected response: {"ok":true}