Submitting Feedback
Submit feedback, bug reports, and ratings with options and metadata
Last updated:
Basic Feedback
Submit feedback with a selected option:
await SessionSightFeedback.submit('bug-report', {
sessionId: currentSessionId,
option: 'critical',
});The feedbackTypeId must match a feedback type slug that exists in your SessionSight dashboard. sessionId is required on every submit. On servers pairing with the Insights SDK, forRequest(req) reads ss_sid off the inbound request so you don’t have to thread it manually.
Full Example
Include message and metadata for richer context:
await SessionSightFeedback.submit('bug-report', {
sessionId: currentSessionId,
option: 'critical',
message: 'The checkout page crashes on Safari',
metadata: {
page: '/checkout',
browser: 'Safari 17',
},
});Use as Ratings
Feedback types are flexible enough to serve as rating systems. Define options that represent your scale, then submit the user’s selection.
Star Ratings (1 to 5)
Create a feedback type called “Star Rating” with options: 1, 2, 3, 4, 5.
await SessionSightFeedback.submit('star-rating', {
sessionId: currentSessionId,
option: '4',
});Sentiment (Good / Neutral / Bad)
Create a feedback type called “Page Feedback” with options: good, neutral, bad. Enable text input for optional comments.
await SessionSightFeedback.submit('page-feedback', {
sessionId: currentSessionId,
option: 'good',
message: 'This article was really helpful!',
});API Reference
SessionSightFeedback.submit(feedbackTypeId, options?)
| Parameter | Type | Default | Description |
|---|---|---|---|
feedbackTypeId | string | required | Feedback type slug from your dashboard |
options.sessionId | string | required | Session the feedback belongs to. Visitor and user identity are resolved from the session on the backend. Use forRequest(req) to auto-attach from the ss_sid cookie. |
options.option | string | - | Selected option value (must match a pre-defined option) |
options.message | string | - | Free-text message (only if feedback type allows text input) |
options.metadata | Record<string, string> | - | Key-value context |
Return Type
interface FeedbackResult {
success: boolean;
error?: string;
}