Adapters are Feedtack's plugin system for persistence. Every adapter implements the FeedtackAdapter interface — five async methods that handle the full feedback lifecycle:
interface FeedtackAdapter {
submit(payload: FeedtackPayload): Promise<void>;
reply(feedbackId: string, reply: Omit<FeedtackReply, "id" | "feedbackId">): Promise<void>;
resolve(feedbackId: string, resolution: Omit<FeedtackResolution, "feedbackId">): Promise<void>;
archive(feedbackId: string, userId: string): Promise<void>;
loadFeedback(filter?: FeedtackFilter): Promise<FeedbackItem[]>;
}Built-in adapters
Feedtack ships three adapters for common use cases:
| Adapter | Use case | Persistence |
|---|---|---|
ConsoleAdapter | Development / testing | None (logs to console) |
LocalStorageAdapter | Prototyping / demos | Browser localStorage |
WebhookAdapter | Production | Your API endpoint |
Choosing an adapter
- Starting out? Use
ConsoleAdapterto see payloads in your browser console. - Building a demo? Use
LocalStorageAdapterfor zero-infrastructure persistence. - Going to production? Use
WebhookAdapterpointed at your API, or build a custom adapter.
Adapter lifecycle
loadFeedback(filter?)— Called on mount to hydrate existing feedback for the current pagesubmit(payload)— Called when the user submits new feedbackreply(feedbackId, reply)— Called when a user replies to a threadresolve(feedbackId, resolution)— Called when feedback is marked as resolvedarchive(feedbackId, userId)— Called when a user archives feedback from their view