@feedkit/feedback-core
v0.1.6
Published
Framework-agnostic feedback capture SDK: console, network, rrweb replay, screenshot, environment — with a Shadow DOM widget UI.
Maintainers
Readme
@feedkit/feedback-core
Framework-agnostic feedback capture SDK. Renders a floating widget inside a Shadow DOM (no CSS leaks) and captures technical context automatically to turn vague reports into reproducible tickets: console logs, network requests, rrweb session replay, screenshot and environment.
rrweb, html2canvas and pako are loaded via dynamic import — they stay
out of your first load.
Install
npm i @feedkit/feedback-coreFor Angular apps, use @feedkit/feedback-angular.
To persist on Supabase without a backend, use @feedkit/feedback-supabase.
Usage (vanilla)
import { FeedbackClient } from '@feedkit/feedback-core';
const client = new FeedbackClient({
transport: {
async send(payload) {
await fetch('/api/feedback', { method: 'POST', body: JSON.stringify(payload) });
return { id: payload.id };
},
},
ui: { position: 'right', theme: 'auto', locale: 'pt-BR' },
});
client.init(); // mounts the launcher + installs captures
client.open('bug'); // open programmatically
client.identify({ id: 'u1', name: 'Ana', email: '[email protected]' });
client.reset();
client.setConsent(false); // opt-out: stops captures and clears buffersWhat gets captured
- Console — patches
console.*(defaultwarn+error), circular buffer, timestamp + stack; always forwards to the real console. - Network —
fetch/XHR method, URL, status, duration. Never captures bodies or auth headers; redacts sensitive query params; allow/deny domain lists. - Replay — rrweb with a sliding ~3 min window, gzipped;
maskAllInputson by default;.lf-maskmasks text,.lf-blockblocks elements. - Screenshot — viewport via html2canvas, with an editor (highlight/hide regions).
- Environment — UA, OS, browser, language, timezone, resolution, viewport, DPR, URL/route, referrer, app version.
Bug reports capture everything; ideas/comments send a lightweight payload. Above
maxUploadBytes (default 4 MB) the replay is trimmed, never blocking the send.
Privacy & accessibility
Password fields and inputs are masked; tokens, passwords and auth headers are never captured. UI is isolated in Shadow DOM, keyboard-navigable (ARIA dialog, focus trap, Esc), i18n pt-BR/en, light/dark/auto theme.
MIT © Eduardo Santana
