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

@sensu-ai/feedback-widget

v0.1.0

Published

Drop-in end-user feedback widget for Sensu β€” collect πŸ‘/πŸ‘Ž + comments under any AI-generated message and forward to the Sensu observability platform.

Readme

@sensu-ai/feedback-widget

Drop-in end-user feedback widget for Sensu. Collects πŸ‘ / πŸ‘Ž + optional comments under any AI-generated message and forwards to Sensu's POST /api/v1/feedback endpoint.

Two entry points:

  • React component β€” import { SensuFeedback } from '@sensu-ai/feedback-widget'
  • Vanilla <script> embed β€” <script src="https://cdn.sensu-ai.com/feedback-widget.js"> exposing window.SensuFeedback.mount(...)

Transport modes

The widget runs in your customer's browser, so it can't carry a secret API key. Pick one:

mode: 'proxy' (default, recommended)

The widget POSTs to your backend, which proxies the payload to Sensu's POST /api/v1/feedback carrying your real (server-side) API key. No credentials in the browser.

<SensuFeedback
  runId="run_abc"
  mode="proxy"
  endpoint="/api/sensu-feedback"
/>

Your backend's /api/sensu-feedback handler receives the JSON FeedbackPayload and forwards it.

mode: 'direct'

The widget POSTs directly to Sensu using a public, feedback-only API key. Easier to deploy; the key is visible in browser bundles, so you must use a feedback_only-scoped API key (created via the dashboard's API Keys page or POST /api/v1/auth/api-keys with { scope: "feedback_only" }). That scope can ONLY hit POST /api/v1/feedback β€” it cannot ingest events, write eval scores, or read any data, so the worst a leaked key can do is spam feedback rows.

<SensuFeedback
  runId="run_abc"
  mode="direct"
  publicKey="pk_public_..."  // a feedback_only-scoped key
/>

React usage

import { SensuFeedback } from '@sensu-ai/feedback-widget';

export function ChatMessage({ runId }: { runId: string }) {
  return (
    <div>
      <p>{message}</p>
      <SensuFeedback
        runId={runId}
        endUserId={currentUser.id}
        mode="proxy"
        endpoint="/api/sensu-feedback"
        onSubmitted={(id) => console.log('submitted', id)}
      />
    </div>
  );
}

Vanilla embed

<div id="my-feedback"></div>
<script src="https://cdn.sensu-ai.com/feedback-widget.js"></script>
<script>
  SensuFeedback.mount('#my-feedback', {
    runId: 'run_abc',
    mode: 'proxy',
    endpoint: '/api/sensu-feedback',
  });
</script>

Wire format

The widget POSTs the same JSON shape Sensu's REST API accepts:

{
  "runId":     "run_abc",
  "type":      "thumbs_up" | "thumbs_down" | "score" | "correction",
  "score":     0.0,                  // optional, [0, 1]
  "comment":   "string",             // optional
  "endUserId": "string"              // optional
}

In proxy mode, your backend should accept the same shape, then call:

POST https://api.sensu-ai.com/api/v1/feedback
X-API-Key: <your server-side key>
Content-Type: application/json

{ ...payload }

Status

v0.1 β€” protocol locked, UI minimal-but-functional, customizable via style / prompt / thanksMessage props.