Skip to content

adobe-rnd/da-feedback

Repository files navigation

da-feedback

Cloudflare Worker that accepts feedback submissions from DA (Document Authoring) and EW (Experience Workspace) and forwards them to Slack via an incoming webhook.

Prerequisites

Setup

1. Install dependencies

npm install

2. Set the Slack webhook secret

The 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 production

Paste your Slack Incoming Webhook URL when prompted.

3. Configure allowed origins

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.

Development

npm run dev

The 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

Testing

npm test           # run once
npm run test:watch # watch mode

Deployment

# Production
npm run deploy

API

POST /feedback

Request headers:

  • Content-Type: application/json
  • Origin: <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

Sample curl request

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}

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors