Feedback Manager Contracts
This page is the contract reference for feedback payloads and provider integration boundaries.
Core Interface
export interface FeedbackProvider {
write(data: FeedbackContext): Promise<FeedbackResponse>;
}
All providers must satisfy this interface. The write contract is the extension seam for adding destinations.
Payload Contracts
FeedbackClientContext
Sent from client to route.
| Field | Type | Notes |
|---|---|---|
| category | FeedbackCategory | Required |
| message | string | Required |
| string or null or undefined | Optional | |
| allowContactThroughEmail | boolean | Required |
| module | PathId | Required module origin |
FeedbackServerContext
Injected by route at runtime.
| Field | Type | Notes |
|---|---|---|
| timestamp | string | ISO timestamp |
| siteId | string | From cookie |
| siteName | string | From cookie |
| userId | string | From cookie |
FeedbackContext
FeedbackContext = FeedbackClientContext & FeedbackServerContext
This is the provider input contract.
FeedbackResponse
| Field | Type | Notes |
|---|---|---|
| success | boolean | Required |
| message | string | Optional success detail |
| error | string | Optional failure detail |
Enums and Allowed Values
FeedbackCategory
Allowed values:
feature_requestworkflow_experiencegeneral
SupportedFeedbackProviderEnum
Current value:
google-sheets
Validation Boundary Notes
- Client-side schema enforces category and minimum message length
- Optional email is accepted as empty, but invalid non-empty email is rejected
- If contact-through-email is selected, email must be present
Provider Extension Checklist
When adding a provider:
- Implement
FeedbackProvider.write - Keep provider-specific env vars local to provider config
- Validate provider config at initialization and fail fast with clear error
- Register provider in factory selection switch
- Add provider documentation file under
providers/ - Add unit tests for success path and failure paths
Related Sources
src/lib/external/FeedbackManager/core/types.tssrc/lib/external/FeedbackManager/provider/factory.tssrc/modules/share-feedback/schema.ts