Skip to content
Feedback Duck
Documentation · v1.0.0

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.

Section 01

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.

Clone and install dependenciesBun + Wrangler
git clone https://github.com/FeedbackDuck/worker.git
cd worker
bun install
Attach custom domain in wrangler.jsoncworkers_dev: false
{
  "vars": {
    "SCREENSHOT_BASE_URL": "https://feedback.example.com/v1/s/"
  },
  "routes": [
    { "pattern": "feedback.example.com", "custom_domain": true }
  ]
}
Upload secrets, verify, and deployscripts/verify.sh
bunx wrangler secret put GITHUB_APP_ID
bunx wrangler secret put GITHUB_APP_PRIVATE_KEY < .github-app.pkcs8.pem
./scripts/verify.sh && bunx wrangler deploy

Configure 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.

Section 02

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.

Manifest CLI setupscripts/setup-github-app.ts
# Personal account
bun run setup:github-app

# GitHub organization
bun run setup:github-app --org your-org
Minimum GitHub App permissions
Minimum GitHub App permissions
IssuesRead and write
MetadataRead-only
WebhooksDisabled

Install the created GitHub App on each repository or organization that receives feedback.

Section 03

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.

apps.jsoncp apps.example.json 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.
Section 04

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.

Android · Git submodule installTag v1.0.0
git submodule add https://github.com/FeedbackDuck/sdk feedback-duck-sdk
git -C feedback-duck-sdk checkout v1.0.0
Android · Gradle composite buildGradle 9.2.1+ · AGP 9.0.1+ · Kotlin 2.2.10+
// settings.gradle.kts
includeBuild("feedback-duck-sdk/android")

// app/build.gradle.kts
dependencies {
    implementation("com.eslamx.feedbackduck:sdk:1.0.0")
}
iOS · Swift 6SwiftPM v1.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()
Android · Jetpack ComposeGradle includeBuild
// 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() }
Android host note: Call 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

appIdrequired
String

Allowlist key in apps.json. Matches ^[a-z0-9-]+$ up to 64 characters.

appNamerequired
String

Host app label displayed in form copy and retry messages.

endpointrequired
URL / String

Your Worker /v1/feedback endpoint. Must use https with a host, no user info, and no whitespace.

isPublicRepofalse
Bool

Hides email input, strips email, and displays the public GitHub notice.

screenshotstrue
Bool

Captures an optional screen image with on-device redaction. Ignored when isPublicRepo is true.

bubble.beta
FeedbackDuckTrigger

Controls the floating button trigger: off, beta (ON in TestFlight/debug), or on.

shake.beta
FeedbackDuckTrigger

Controls the shake trigger: off, beta, or on.

bubbleBottomInset100
CGFloat / Dp

Keeps the snapped floating bubble above bottom host app controls.

brandingtrue
Bool

Controls only the 'Sent with Feedback Duck' footer line inside the form.

theme.default
FeedbackDuckTheme

Custom light and dark color tokens, card radii, and font overrides.

Section 05

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.

Open feedback.v1.schema.json
Sample request bodyPOST /v1/feedback
{
  "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"
  }
}
HTTP status responses
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.