git-feedback
v0.5.1
Published
Embeddable feedback collection with pluggable issue-tracker adapters
Readme
git-feedback
Git Feedback adds a React feedback widget and a Fetch-based server route that turns submissions into GitHub issues, Linear issues, or records in your own backend.
Install
bun add git-feedback
npm install git-feedback
pnpm add git-feedback
yarn add git-feedbackReact and React DOM are peer dependencies. Install @octokit/core and @octokit/plugin-rest-endpoint-methods only for the GitHub provider. Install @linear/sdk only for the Linear provider.
Quick Start
Render the widget:
import 'git-feedback/react/styles.css';
import { FeedbackWidget } from 'git-feedback/react';
export function AppFeedback() {
return <FeedbackWidget />;
}Create the default /api/feedback endpoint:
import { createFeedbackEndpoint } from 'git-feedback/server';
export const feedbackEndpoint = createFeedbackEndpoint({
adapter: {
async createIssue(input) {
const record = await saveFeedback(input);
return {
id: record.id,
title: input.title,
};
},
},
});Expose the handler from your framework route by passing each incoming Request to feedbackEndpoint(request).
Imports
git-feedback/react: browser-safe React components, hooks, and types.git-feedback/react/styles.css: optional widget stylesheet.git-feedback/server: server-only endpoint helpers and types.git-feedback/github: GitHub adapter.git-feedback/linear: Linear adapter and attachment storage.git-feedback/package.json: package metadata.
The package does not expose a root import. Keep server, GitHub, and Linear imports in server-only files.
