npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@trame.sh/widget

v0.1.1

Published

Embeddable feedback widget for trame

Downloads

125

Readme

@trame.sh/widget

Embeddable feedback widget for trame - collect user feedback from your applications.

Installation

NPM Package

npm install @trame.sh/widget
# or
pnpm add @trame.sh/widget

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://unpkg.com/@trame.sh/widget/dist/cdn/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_xxxxxxxx',
});
</script>

Usage

Basic Setup (NPM)

import { TrameWidget } from '@trame.sh/widget';

TrameWidget.init({
  projectId: 'proj_abc123',
  apiKey: 'tk_pub_xxxxxxxx',
});

Configuration Options

TrameWidget.init({
  // Required
  projectId: 'proj_abc123',
  apiKey: 'tk_pub_xxxxxxxx',
  
  // Optional
  theme: 'auto',              // 'light' | 'dark' | 'auto'
  position: 'bottom-right',   // 'bottom-right' | 'bottom-left'
  triggerLabel: 'Feedback',
  formTitle: 'Send Feedback',
  autoInject: true,           // Auto-inject trigger button
  
  // Pre-fill user info
  user: {
    name: 'Jane Doe',
    email: '[email protected]',
    id: 'usr_123',
  },
  
  // Callbacks
  onOpen: () => console.log('Widget opened'),
  onSubmit: (feedback) => console.log('Feedback submitted:', feedback),
  onError: (err) => console.error('Error:', err),
});

Custom Trigger (BYOUI)

// Don't auto-inject the default trigger
TrameWidget.init({
  projectId: 'proj_abc123',
  apiKey: 'tk_pub_xxxxxxxx',
  autoInject: false,
});

// Attach to your own button
TrameWidget.attachTo('#my-feedback-button');

Programmatic Submission

// Submit feedback without showing the form
await TrameWidget.submit({
  message: 'The save button is broken',
  user: { name: 'Jane', email: '[email protected]' },
  metadata: { page: '/settings', version: '2.1.0' },
});

Update Configuration

// Update config after initialization
TrameWidget.update({
  user: { name: 'New User', email: '[email protected]' },
});

Cleanup

// Clean up widget (useful for SPAs)
TrameWidget.destroy();

Features

  • Shadow DOM Isolation: Styles don't conflict with your app
  • Lightweight: Small bundle size with no dependencies
  • Theming: Light, dark, and auto modes
  • Customizable: Custom trigger, labels, and callbacks
  • Type-safe: Full TypeScript support
  • Framework-agnostic: Works with any JS framework

API Endpoint

The widget submits feedback to POST /api/feedback with the following payload:

{
  "project_id": "uuid",
  "message": "User feedback message",
  "source_url": "https://app.example.com/page",
  "user_name": "Jane Doe",
  "user_email": "[email protected]",
  "user_external_id": "usr_123",
  "metadata": {
    "page": "/dashboard",
    "version": "2.1.0"
  }
}

Development

# Install dependencies
pnpm install

# Run tests
pnpm test

# Build
pnpm build

# Watch mode
pnpm dev

License

MIT