Skip to content

Add a web feedback widget (agentback/web and widget.js), release 0.3.0 - #3

Merged
fatwang2 merged 1 commit into
mainfrom
claude/project-thread-0erksz
Oct 29, 2026
Merged

fatwang2 merged 1 commit into
mainfrom
claude/project-thread-0erksz

Conversation

@fatwang2

Copy link
Copy Markdown
Member

Requested by fatwang2 · project thread

Customers had no way to collect feedback from the people using their web app. This adds a feedback widget to the SDK, in two forms built from one source:

  • agentback/web: createFeedbackWidget({ projectKey, ... }) for apps with a bundler.
  • agentback/widget.js: a minified IIFE (about 8.7 KB gzipped) that reads data- attributes from its script tag. Agentback serves it at https://agentback.app/widget.js from the installed package (fatwang2/agentback, separate PR).

What it does

  • Floating Feedback button and a panel: optional type (Problem, Idea, Other), a message, and Send (or ⌘/Ctrl+Enter). Sending, sent and failed states; a 429 gets its own message; the draft survives a failure or closing the panel.
  • Reports go to the public address with source web and page (origin and path, never the query string).
  • Orange by default; neutral, blue, violet or any hex colour, with readable text picked by contrast. Follows light/dark (theme), takes the page's font, Shadow DOM so neither side's CSS leaks.
  • launcher: false plus data-agentback-open on the customer's own menu item opens the panel next to that element.
  • categories relabels, reorders or hides the types; stored values stay the fixed four.
  • Signed accounts: identity / identify({ account, signature }), or data-account and data-signature. An unsigned account is dropped with a console warning instead of failing the send.
  • en and zh built in, picked from the page's lang; every string can be overridden with text.
  • Phones get a bottom sheet with larger targets and a 16px field (no iOS zoom).
  • Source gains web, and Feedback gains page.

The server must accept web and page before this is released; that change is in the Agentback PR.

Checks

npm run format:check, npm run typecheck, npm test (new test/web.test.ts on happy-dom: submission body, rate-limit state, relabelled and hidden types, own-menu trigger, signed and unsigned identity, Chinese locale, colour contrast) and npm run check:package (now also imports agentback/web in a clean Node consumer and resolves agentback/widget.js) all pass. Rendered in Chromium on desktop, dark mode and a 390px phone, and run end to end against a local Agentback: the report arrived in the inbox with source web and the page path.

Version bumped to 0.3.0. After merge, run the Release workflow on main.


Generated by Claude Code

agentback/web exports createFeedbackWidget, and the build also emits
dist/widget.js, a script-tag bundle that Agentback serves at /widget.js.
The panel sends reports with source web and the page's origin and path,
defaults to Agentback orange with presets or any hex colour, follows light
and dark, uses the page's font, and becomes a bottom sheet on phones.
Customers can hide the floating button and open it from their own menu
with data-agentback-open, relabel or hide the types, and attach a signed
account.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DuYf7tYxMy7gcDTagH5hjC
@fatwang2 fatwang2 self-assigned this Oct 29, 2026
@fatwang2
fatwang2 merged commit 6583d17 into main Oct 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants