Self-host Worker, SDK install, and API contract v1
Feedback Duck runs inside your own Cloudflare account and writes directly to your GitHub repositories. Review every command and payload field below.
Self-host the Cloudflare Worker
Use Deploy to Cloudflare or clone FeedbackDuck/worker directly. The Worker uses a SHOTS R2 bucket and Cloudflare rate limits. Keep workers_dev off and attach your own custom domain.
git clone https://github.com/FeedbackDuck/worker.git
cd worker
bun install{
"vars": {
"SCREENSHOT_BASE_URL": "https://feedback.example.com/v1/s/"
},
"routes": [
{ "pattern": "feedback.example.com", "custom_domain": true }
]
}bunx wrangler secret put GITHUB_APP_ID
bunx wrangler secret put GITHUB_APP_PRIVATE_KEY < .github-app.pkcs8.pem
./scripts/verify.sh && bunx wrangler deployConfigure an R2 bucket lifecycle rule on shots/ to expire stored screenshots after 180 days. Delete .github-app.pkcs8.pem after saving it in your password manager, then verify your route with scripts/smoke.sh.
Create your GitHub App
Run the manifest helper inside the Worker repository. It opens GitHub in your browser, converts the private key to PKCS#8 with mode 0600, and prints the exact wrangler secret put commands without printing the key.
# Personal account
bun run setup:github-app
# GitHub organization
bun run setup:github-app --org your-org| Issues | Read and write |
| Metadata | Read-only |
| Webhooks | Disabled |
Install the created GitHub App on each repository or organization that receives feedback.
Configure apps.json
Copy apps.example.json to apps.json. The file is gitignored so your private repository list stays out of git by default. Keep your fork private before running git add -f apps.json.
{
"my-app-ios": {
"repo": "your-org/my-app-ios",
"enabled": true,
"origins": []
},
"my-app-web": {
"repo": "your-org/my-app-web",
"enabled": true,
"origins": ["https://app.example.com"]
}
}- appId is a public keyUse lowercase letters, digits, and hyphens up to 64 characters. Do not store secrets in appId.
- Native vs browser originsNative mobile apps send no Origin header. List allowed HTTPS origins only for web apps.
- Instant kill switchSet "enabled" to false and redeploy to reject reports with 403 app_not_allowed.
Install and configure native SDKs
FeedbackDuck/sdk supports iOS 17 or later (Swift 6) and Android minSdk 26 or later (Jetpack Compose). You must pass your own HTTPS Worker URL.
git submodule add https://github.com/FeedbackDuck/sdk feedback-duck-sdk
git -C feedback-duck-sdk checkout v1.0.0// settings.gradle.kts
includeBuild("feedback-duck-sdk/android")
// app/build.gradle.kts
dependencies {
implementation("com.eslamx.feedbackduck:sdk:1.0.0")
}// Package URL: https://github.com/FeedbackDuck/sdk (1.0.0)
import FeedbackDuck
let endpoint = URL(
string: "https://feedback.example.com/v1/feedback"
)!
let config = FeedbackDuckConfig(
appId: "my-app-ios",
appName: "My App",
endpoint: endpoint
)
FeedbackDuck.configure(config)
ContentView().feedbackDuck()// settings.gradle.kts: includeBuild("feedback-duck-sdk/android")
// dependency: implementation("com.eslamx.feedbackduck:sdk:1.0.0")
val config = FeedbackDuckConfig(
appId = "my-app-android",
appName = "My App",
endpoint = "https://feedback.example.com/v1/feedback",
)
FeedbackDuck.configure(context, config)
FeedbackDuckHost { AppContent() }enableEdgeToEdge() in your host Activity so the floating bubble tracks keyboard insets reliably. Trigger feedback manually from any screen with FeedbackDuck.present() on iOS or FeedbackDuck.present(context) on Android.FeedbackDuckConfig options
appIdrequiredAllowlist key in apps.json. Matches ^[a-z0-9-]+$ up to 64 characters.
appNamerequiredHost app label displayed in form copy and retry messages.
endpointrequiredYour Worker /v1/feedback endpoint. Must use https with a host, no user info, and no whitespace.
isPublicRepofalseHides email input, strips email, and displays the public GitHub notice.
screenshotstrueCaptures an optional screen image with on-device redaction. Ignored when isPublicRepo is true.
bubble.betaControls the floating button trigger: off, beta (ON in TestFlight/debug), or on.
shake.betaControls the shake trigger: off, beta, or on.
bubbleBottomInset100Keeps the snapped floating bubble above bottom host app controls.
brandingtrueControls only the 'Sent with Feedback Duck' footer line inside the form.
theme.defaultCustom light and dark color tokens, card radii, and font overrides.
| Field | Type | Default | Notes |
|---|---|---|---|
| appId | String | required | Allowlist key in apps.json. Matches ^[a-z0-9-]+$ up to 64 characters. |
| appName | String | required | Host app label displayed in form copy and retry messages. |
| endpoint | URL / String | required | Your Worker /v1/feedback endpoint. Must use https with a host, no user info, and no whitespace. |
| isPublicRepo | Bool | false | Hides email input, strips email, and displays the public GitHub notice. |
| screenshots | Bool | true | Captures an optional screen image with on-device redaction. Ignored when isPublicRepo is true. |
| bubble | FeedbackDuckTrigger | .beta | Controls the floating button trigger: off, beta (ON in TestFlight/debug), or on. |
| shake | FeedbackDuckTrigger | .beta | Controls the shake trigger: off, beta, or on. |
| bubbleBottomInset | CGFloat / Dp | 100 | Keeps the snapped floating bubble above bottom host app controls. |
| branding | Bool | true | Controls only the 'Sent with Feedback Duck' footer line inside the form. |
| theme | FeedbackDuckTheme | .default | Custom light and dark color tokens, card radii, and font overrides. |
API contract v1
Clients send JSON matching JSON Schema 2020-12 to POST /v1/feedback. Unknown top-level or diagnostics keys fail validation with HTTP 400.
{
"v": 1,
"appId": "my-app-ios",
"reportId": "3f0c9a5e-6b21-4c0d-9e77-2a4b8d1c5e90",
"installId": "kM3nQ7pR2sT8vW1xY4zA6B",
"type": "bug",
"title": "Filter resets after screen rotation",
"message": "When I rotate the phone on the search tab, the active filter clears.",
"diagnostics": {
"platform": "ios",
"osVersion": "18.2",
"appVersion": "1.4.0",
"build": "241",
"locale": "en-US"
}
}{"ok":true,"reportId":"...","issueUrl":"..."}Issue created. issueUrl returns only for public repositories.
{"ok":false,"error":"invalid:message"}Schema violation (invalid:<field>), bad JSON (invalid_json), unknown key (unknown_key:<name>), or invalid screenshot.
{"ok":false,"error":"app_not_allowed"}Unknown or disabled appId (app_not_allowed), or a browser Origin not in the app's origins list (origin_not_allowed).
{"ok":false,"error":"not_found"}Request path is not /v1/feedback or a valid screenshot key.
{"ok":false,"error":"method_not_allowed"}Method is not POST or OPTIONS on /v1/feedback, or not GET or HEAD on /v1/s/ (the Allow header lists the valid methods).
{"ok":false,"error":"payload_too_large"}Text JSON body exceeds 16384 bytes, or full request exceeds 720896 bytes.
{"ok":false,"error":"rate_limited"}Limit hit (3 per 60s per installId or 20 per 60s per appId). Includes Retry-After.
{"ok":false,"error":"upstream_failed"}GitHub API call failed. Clients keep the local draft and retry later.
| 201 | {"ok":true,"reportId":"...","issueUrl":"..."} | Issue created. issueUrl returns only for public repositories. |
| 400 | {"ok":false,"error":"invalid:message"} | Schema violation (invalid:<field>), bad JSON (invalid_json), unknown key (unknown_key:<name>), or invalid screenshot. |
| 403 | {"ok":false,"error":"app_not_allowed"} | Unknown or disabled appId (app_not_allowed), or a browser Origin not in the app's origins list (origin_not_allowed). |
| 404 | {"ok":false,"error":"not_found"} | Request path is not /v1/feedback or a valid screenshot key. |
| 405 | {"ok":false,"error":"method_not_allowed"} | Method is not POST or OPTIONS on /v1/feedback, or not GET or HEAD on /v1/s/ (the Allow header lists the valid methods). |
| 413 | {"ok":false,"error":"payload_too_large"} | Text JSON body exceeds 16384 bytes, or full request exceeds 720896 bytes. |
| 429 | {"ok":false,"error":"rate_limited"} | Limit hit (3 per 60s per installId or 20 per 60s per appId). Includes Retry-After. |
| 502 | {"ok":false,"error":"upstream_failed"} | GitHub API call failed. Clients keep the local draft and retry later. |
Deploy your own Worker
Copy FeedbackDuck/worker to Cloudflare, run bun run setup:github-app, and connect your apps.