Feedback Widget Tools

Collect user feedback from your applications with embeddable widget and MCP tools

The trame feedback widget allows you to collect user feedback directly from your applications. Users can submit feedback through an embeddable widget, and you can manage API keys and review submissions using natural language commands in your MCP client.

Widget Integration
The feedback widget is available as an NPM package (@trame.sh/widget) or via CDN. Each project can have multiple API keys for different environments (production, staging, development).

Getting Started

Setting up feedback collection involves creating API keys, integrating the widget into your application, and reviewing submissions through MCP tools. Here's the typical workflow:

1

Create API Key

Generate a publishable API key for your project to authenticate widget submissions.
2

Integrate Widget

Add the feedback widget to your application using the generated API key.
3

Review Feedback

List and analyze feedback submissions using natural language commands.
4

Archive Processed Items

Mark feedback as archived once you've addressed it or extracted actionable items.

API Key Management

create_api_key
Generate a new publishable API key for the feedback widget. The full key is shown only once upon creation - store it securely. You can create multiple keys per project for different environments.

Parameters

project_id
string
required

The UUID of the project (from list_projects or create_project)

label
string

Optional label to identify this key (e.g., "Production", "Staging")

Returns

Success message with the full API key (shown only once). The key starts with 'tk_pub_' and must be stored securely. Also returns key metadata including ID, prefix, and creation timestamp.

Example

Natural Language Examples:

"Create an API key for project proj_abc123"

"Generate a feedback widget API key for my Task Manager project labeled Production"

"I need an API key for the staging environment of project proj_xyz789"

Expected Response:
✓ API Key created successfully!

API Key: tk_pub_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6
⚠️  Save this key now - it won't be shown again!

Key ID: key_abc123
Prefix: tk_pub_a1b2
Label: Production
Created: 2025-02-13T10:00:00Z

Use this key to initialize the feedback widget in your application.
Security
API keys are shown only once during creation. Store them securely. Keys starting with tk_pub_ are publishable (safe for client-side use), but should still be treated as sensitive credentials. Rotate keys regularly and revoke unused keys.
list_api_keys
List all API keys for a project. For security, only the key prefix is shown (full keys are never retrievable after creation). Shows active and revoked keys with metadata.

Parameters

project_id
string
required

The UUID of the project

Returns

List of API keys with prefix, label, status (active/revoked), last used timestamp, and creation date. Full keys are never shown after creation.

Example

Natural Language Examples:

"Show me API keys for project proj_abc123"

"List feedback widget keys for my Task Manager project"

"What API keys do I have for the Social Network API project?"

Expected Response (with keys):
✓ API Keys for project proj_abc123 (2 keys):

1. tk_pub_a1b2...
   Label: Production
   Status: Active
   Last Used: 2025-02-13T09:45:00Z
   Created: 2025-02-10T10:00:00Z

2. tk_pub_x9y8...
   Label: Staging
   Status: Revoked (2025-02-12T15:30:00Z)
   Created: 2025-02-01T14:00:00Z

Expected Response (no keys):
No API keys found for project proj_abc123.
Use create_api_key to generate your first key.
revoke_api_key
Revoke an API key permanently. Once revoked, the key can no longer authenticate widget submissions. This action cannot be undone. Use this when rotating keys or removing access.

Parameters

api_key_id
string
required

The UUID of the API key to revoke (from list_api_keys)

Returns

Success message with revoked key details including prefix, label, and revocation timestamp.

Example

Natural Language Examples:

"Revoke API key key_abc123"

"I need to revoke the staging API key for my project"

"Disable the old production feedback widget key"

Expected Response:
✓ API Key revoked successfully!

Key Prefix: tk_pub_a1b2...
Label: Staging
Revoked At: 2025-02-13T10:00:00Z

This key can no longer authenticate widget submissions.
Create a new key if you need to restore access.
Key Rotation
Best practice: Create a new key before revoking the old one to avoid service interruption. Update your application with the new key, verify it's working, then revoke the old key.

Feedback Management

list_feedback
List feedback submissions for a project with pagination and filtering. Review user-submitted feedback, including messages, source URLs, user information, and custom metadata. Use this to analyze feedback patterns and extract feature requests.

Parameters

project_id
string
required

The UUID of the project

include_archived
boolean

Include archived feedback (default: false)

limit
number

Number of items to return (1-200, default: 50)

offset
number

Number of items to skip for pagination (default: 0)

Returns

List of feedback submissions with ID, message, source URL, user information (name, email, external ID), custom metadata, archived status, and creation timestamp. Includes pagination metadata (total, limit, offset).

Example

Natural Language Examples:

"Show me feedback for project proj_abc123"

"List unarchived feedback for my Task Manager project"

"Get the next 20 feedback items for project proj_xyz789"

"Show me all feedback including archived for the Social Network API project"

Expected Response (with feedback):
✓ Feedback for project proj_abc123 (3 items, showing 1-3 of 15 total):

1. [fb_001] 2025-02-13T09:30:00Z
   Message: "The dashboard loads very slowly, takes about 10 seconds"
   Source: https://app.example.com/dashboard
   User: Jane Doe (jane@example.com)
   Metadata: {"page": "/dashboard", "browser": "Chrome"}
   Status: Active

2. [fb_002] 2025-02-13T09:15:00Z
   Message: "Love the new export feature! Can we get CSV support?"
   Source: https://app.example.com/reports
   User: John Smith
   Status: Active

3. [fb_003] 2025-02-13T08:45:00Z
   Message: "The mobile menu doesn't close when I tap outside"
   Source: https://app.example.com/settings
   User: Anonymous
   Metadata: {"device": "iPhone 13", "os": "iOS 17"}
   Status: Archived

Pagination: Showing 1-3 of 15 total (use offset to see more)

Expected Response (no feedback):
No feedback found for project proj_abc123.
Feedback will appear here once users submit through the widget.
archive_feedback
Archive one or more feedback submissions after processing. Archived feedback is hidden from default lists but can be retrieved with the include_archived filter. Use this to mark feedback as addressed or to keep your active feedback list focused.

Parameters

feedback_ids
array
required

Array of feedback UUIDs to archive (from list_feedback)

Returns

Success message with count of archived feedback items.

Example

Natural Language Examples:

"Archive feedback fb_001"

"Archive feedback items fb_001, fb_002, and fb_003"

"Mark the dashboard performance feedback as archived"

Expected Response:
✓ Successfully archived 3 feedback items.

These items are now hidden from default feedback lists.
Use include_archived=true with list_feedback to view them.
Archiving vs Deletion
Archiving preserves feedback history while keeping your active list focused. Archived feedback can still be retrieved with include_archived=true. Feedback is never deleted to maintain a complete audit trail.

Widget Integration

After creating an API key, integrate the feedback widget into your application. The widget supports both NPM package and CDN deployment methods.

NPM Package Installation

npm install @trame.sh/widget

// In your application code:
import { TrameWidget } from '@trame.sh/widget';

TrameWidget.init({
  projectId: 'proj_abc123',
  apiKey: 'tk_pub_your_api_key_here',
  theme: 'auto',              // 'light' | 'dark' | 'auto'
  position: 'bottom-right',   // 'bottom-right' | 'bottom-left'
  triggerLabel: 'Feedback',   // Button text
});

CDN Script Tag

<script>
!function(w,d,i,s){function l(){if(!d.getElementById(i)){
  var f=d.getElementsByTagName(s)[0],e=d.createElement(s);
  e.type="text/javascript";e.async=true;e.id=i;
  e.src="https://widget.trame.dev/v1/trame-widget.js";
  f.parentNode.insertBefore(e,f)}}if("function"!=typeof w.Trame){
  var c=function(){c.q.push(arguments)};c.q=[];w.Trame=c;
  "complete"===d.readyState?l():w.addEventListener("load",l,false)
}}(window,document,"trame-widget-js","script");

Trame('init', {
  projectId: 'proj_abc123',
  apiKey: 'tk_pub_your_api_key_here',
});
</script>

For detailed integration documentation and customization options, visit the trame-widget repository.

Common Workflows

Initial Setup

Set up feedback collection for a new project:

You: "Create a feedback API key for my Task Manager project labeled Production"

Your AI assistant (internally calls create_api_key):
✓ API Key created: tk_pub_a1b2c3d4e5f6g7h8...
⚠️  Save this key now - it won't be shown again!

You: "Great, now show me how to integrate it"

Your AI assistant: Here's how to add the widget to your application:
[Shows NPM or CDN integration code with your API key]

Reviewing Feedback

Regularly review and process user feedback:

You: "Show me recent feedback for the Task Manager project"

Your AI assistant (internally calls list_feedback):
✓ 5 new feedback items:
1. Dashboard loads slowly (Jane Doe)
2. Export to CSV feature request (John Smith)
3. Mobile menu bug (Anonymous)
...

You: "The dashboard performance issue looks important. 
     Let me create a feature for that, then archive this feedback"

Your AI assistant: I'll help you create a feature and archive the feedback.
[Creates feature, then archives feedback items]

Key Rotation

Rotate API keys for security best practices:

You: "List API keys for my Task Manager project"

Your AI assistant (internally calls list_api_keys):
✓ 2 API keys found:
1. tk_pub_old... (Production) - Active since 2024-01-01
2. tk_pub_staging... (Staging) - Active

You: "Create a new production key, I want to rotate the old one"

Your AI assistant (internally calls create_api_key):
✓ New key created: tk_pub_new...

You: "Now revoke the old production key"

Your AI assistant (internally calls revoke_api_key):
✓ Old production key revoked successfully!

Extracting Actionable Features

Use agentic CLI to analyze feedback and extract feature requests:

You: "Review all feedback for my project and identify common themes"

Your AI assistant (internally calls list_feedback):
[Analyzes feedback submissions]

I found 3 common themes:
1. Performance (5 mentions) - Dashboard and report loading
2. Export Features (3 mentions) - CSV, PDF export requests
3. Mobile UI Issues (2 mentions) - Menu and responsive layout

You: "Create features for the top 2 themes"

Your AI assistant: I'll create features for performance improvements and export functionality.
[Creates features, links related feedback IDs in spec_content]

Best Practices

API Key Management

  • Use descriptive labels for keys (Production, Staging, Development)
  • Create separate keys for different environments
  • Rotate keys regularly (quarterly or after team changes)
  • Revoke keys immediately if compromised
  • Store keys securely (environment variables, secret managers)

Feedback Processing

  • Review feedback regularly (daily or weekly)
  • Archive feedback after extracting actionable items
  • Use natural language to ask your AI assistant to identify patterns
  • Link feedback IDs to features/plans for traceability
  • Keep active feedback list focused by archiving processed items

Widget Integration

  • Test the widget in staging before production deployment
  • Use theme: 'auto' to match user's system preferences
  • Customize trigger label to fit your application's language
  • Consider providing user context (name, email) when available
  • Monitor submission rates and adjust widget placement if needed

Agentic Workflow

  • Ask your AI assistant to analyze feedback for common themes
  • Use natural language to filter and search feedback
  • Create features directly from feedback insights
  • Archive feedback in batches after processing
  • Review archived feedback periodically for missed patterns

Rate Limits

The feedback submission endpoint has the following rate limits per API key:

  • 60 requests per minute - Short-term burst protection
  • 1,000 requests per day - Daily quota per key

If you expect higher submission volumes, create multiple API keys or contact support for increased limits. MCP tool calls (list_feedback, archive_feedback, etc.) follow standard user rate limits (100/min, 1000/hour).