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

vibepanel-sdk

v0.1.0

Published

Track AI costs, feature usage, and per-user profitability

Readme

vibepanel-sdk

Track AI costs, feature usage, and per-user profitability from inside your app.

VibePanel tells you which users are profitable, which features cost money, and who's burning your AI budget — data that Stripe and OpenAI can't give you alone.

Install

npm install vibepanel-sdk

Quick start

import { VibePanel } from 'vibepanel-sdk'

const vp = new VibePanel({
  writeKey: process.env.VIBEPANEL_WRITE_KEY,
})

// After any AI call — fire and forget, no await needed
vp.ai({
  userId: req.user.id,
  model: 'gpt-4o',
  inputTokens: response.usage.prompt_tokens,
  outputTokens: response.usage.completion_tokens,
  feature: 'chat',
})

What you can track

AI calls

vp.ai({
  userId: 'user_123',
  model: 'gpt-4o',
  inputTokens: 1200,
  outputTokens: 340,
  feature: 'essay_generator',
  latencyMs: 1842,
  metadata: { prompt_version: 'v2' },
})

User identification

vp.identify({
  userId: 'user_123',
  plan: 'pro',
  monthlyRevenue: 49.00,
  email: '[email protected]',
})

Feature usage

vp.feature({
  userId: 'user_123',
  feature: 'pdf_summarizer',
  action: 'run',
})

Generic events

vp.event({
  userId: 'user_123',
  name: 'export_completed',
  metadata: { format: 'pdf', pages: 24 },
})

How it works

  • Events queue in memory and flush every 2 seconds (configurable)
  • Failed sends retry 3 times, then drop silently — never crashes your app
  • Zero runtime dependencies
  • Costs are calculated server-side — the SDK just sends model + token counts

Configuration

const vp = new VibePanel({
  writeKey: process.env.VIBEPANEL_WRITE_KEY,  // required
  flushInterval: 2000,   // ms between flushes (default: 2000)
  maxBatchSize: 50,      // events per batch (default: 50)
  debug: false,          // log to console (default: false)
})

Serverless (Next.js, Vercel, Lambda)

In serverless environments, flush before the function exits:

export async function POST(req: Request) {
  const response = await openai.chat.completions.create({ ... })

  vp.ai({ userId, model, inputTokens, outputTokens })
  await vp.flush()

  return Response.json({ result: response })
}

Graceful shutdown

process.on('SIGTERM', async () => {
  await vp.shutdown()
  process.exit(0)
})

Requirements

  • Node.js 18+ (uses native fetch)
  • Server-side only — never expose the write key in client code

Get your write key

  1. Sign up at vibepanel.app
  2. Create a project
  3. Go to Settings → SDK tab
  4. Click Generate Write Key

Docs

Full documentation at docs.vibepanel.app

License

MIT