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

feedbackkit-js

v1.0.1

Published

JavaScript SDK for FeedbackKit - In-app feedback collection

Readme

FeedbackKit JavaScript SDK

JavaScript/TypeScript SDK for FeedbackKit - In-app feedback collection.

npm TypeScript License

Features

  • TypeScript-first - Full type definitions included
  • Zero dependencies - Uses native fetch
  • Tree-shakeable - Only import what you need
  • Universal - Works in Node.js 18+ and modern browsers

Installation

npm install feedbackkit-js
# or
yarn add feedbackkit-js
# or
pnpm add feedbackkit-js

Quick Start

import { FeedbackKit, FeedbackCategory } from 'feedbackkit-js';

// Initialize the client
const feedbackKit = new FeedbackKit({
  apiKey: 'sf_your_api_key',
  userId: 'user_12345' // optional, for hasVoted state
});

// List feedback
const feedbacks = await feedbackKit.feedback.list();

// Submit feedback
const newFeedback = await feedbackKit.feedback.create({
  title: 'Add dark mode',
  description: 'Please add dark mode support.',
  category: FeedbackCategory.FeatureRequest,
  userId: 'user_12345'
});

// Vote for feedback
const voteResult = await feedbackKit.votes.vote('feedback-id', {
  userId: 'user_12345'
});

API Reference

Configuration

const feedbackKit = new FeedbackKit({
  apiKey: 'sf_your_api_key',      // Required: Your project API key
  baseUrl: 'https://...',          // Optional: Custom API URL
  userId: 'user_12345',            // Optional: Current user ID
  timeout: 30000                   // Optional: Request timeout (ms)
});

Feedback

// List all feedback
const feedbacks = await feedbackKit.feedback.list();

// Filter by status
const pending = await feedbackKit.feedback.list({
  status: FeedbackStatus.Pending
});

// Filter by category
const bugs = await feedbackKit.feedback.list({
  category: FeedbackCategory.BugReport
});

// Get single feedback
const feedback = await feedbackKit.feedback.get('feedback-id');

// Submit feedback
const newFeedback = await feedbackKit.feedback.create({
  title: 'Feature title',
  description: 'Detailed description...',
  category: FeedbackCategory.FeatureRequest,
  userId: 'user_12345',
  userEmail: '[email protected]' // optional
});

Voting

// Vote for feedback
const result = await feedbackKit.votes.vote('feedback-id', {
  userId: 'user_12345'
});

// Vote with email notification opt-in
const result = await feedbackKit.votes.vote('feedback-id', {
  userId: 'user_12345',
  email: '[email protected]',
  notifyStatusChange: true
});

// Remove vote
const result = await feedbackKit.votes.unvote('feedback-id', {
  userId: 'user_12345'
});

Comments

// List comments
const comments = await feedbackKit.comments.list('feedback-id');

// Add comment
const comment = await feedbackKit.comments.create('feedback-id', {
  content: 'Great idea!',
  userId: 'user_12345',
  isAdmin: false
});

User Registration

// Register/update user
const user = await feedbackKit.users.register({
  userId: 'user_12345',
  mrr: 9.99 // Monthly Recurring Revenue (optional)
});

Event Tracking

// Track custom event
await feedbackKit.events.track({
  eventName: 'feedback_list',
  userId: 'user_12345',
  properties: {
    filter: 'feature_request'
  }
});

Error Handling

import {
  FeedbackKit,
  AuthenticationError,
  PaymentRequiredError,
  ForbiddenError,
  NotFoundError,
  ConflictError
} from 'feedbackkit-js';

try {
  await feedbackKit.votes.vote('feedback-id', { userId: 'user_123' });
} catch (error) {
  if (error instanceof AuthenticationError) {
    // Invalid API key (401)
  } else if (error instanceof PaymentRequiredError) {
    // Subscription limit exceeded (402)
  } else if (error instanceof ForbiddenError) {
    // Action not allowed - archived project or voting blocked (403)
  } else if (error instanceof NotFoundError) {
    // Feedback not found (404)
  } else if (error instanceof ConflictError) {
    // Already voted (409)
  }
}

Types

All types are exported for TypeScript users:

import type {
  Feedback,
  FeedbackStatus,
  FeedbackCategory,
  Comment,
  VoteResponse,
  SDKUser,
  TrackedEvent
} from 'feedbackkit-js';

Feedback Statuses

| Status | Description | Can Vote | |--------|-------------|----------| | pending | New, awaiting review | Yes | | approved | Accepted for consideration | Yes | | in_progress | Being worked on | Yes | | testflight | Available in beta | Yes | | completed | Shipped | No | | rejected | Won't implement | No |

Feedback Categories

| Category | Description | |----------|-------------| | feature_request | New functionality | | bug_report | Issue or problem | | improvement | Enhancement | | other | General feedback |

Related Packages

License

MIT License - see LICENSE for details.