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

krypton-hub

v0.1.0

Published

SDK leve para enviar eventos, receita e erros ao Krypton Hub.

Readme

krypton-hub

SDK leve para enviar eventos, receita e erros ao Krypton Hub — painel central que agrega métricas de todos os seus MVPs em um só lugar.

Instalar

npm install krypton-hub
# ou
pnpm add krypton-hub
# ou
yarn add krypton-hub

Funciona em Node 18+ e em qualquer ambiente com fetch global (browser, Edge, Bun, Deno).

Configurar

Pegue sua ingest_key no dashboard do Hub: https://hub.178.105.240.224.nip.io/mvps/<seu-mvp> → seção "Integração SDK".

import { Krypton } from 'krypton-hub';

const k = new Krypton({
  key: process.env.KRYPTON_KEY!, // krp_live_...
});

Em Next.js / Vercel

Use uma única instância singleton:

// lib/krypton.ts
import { Krypton } from 'krypton-hub';

export const k = new Krypton({ key: process.env.KRYPTON_KEY! });

Uso

Eventos de uso

k.track('pageview', { path: '/pricing' });
k.track('signup_completed', { plan: 'pro', source: 'organic' });
k.track('checkout_abandoned', { cart_value: 9990 });

Eventos são enfileirados e enviados em batch a cada 5s (configurável via flushIntervalMs).

Receita / assinaturas

// Novo cliente (status default: active)
await k.trackRevenue({
  customerId: 'c_user_123',
  plan: 'pro',
  mrr: 4990,         // em centavos, R$ 49,90
  email: '[email protected]',
  name: 'Alice Silva',
});

// Mudança de status (ex.: cancelamento)
await k.trackRevenue({
  customerId: 'c_user_123',
  mrr: 0,
  status: 'canceled',
});

Receita é enviada imediatamente (não enfileira), porque dispara notificação no Discord do Hub.

Erros

try {
  await foo();
} catch (err) {
  await k.captureError(err, { userId: '123', route: '/api/foo' });
  throw err;
}

Erros são agrupados automaticamente por fingerprint (mensagem + topo do stack), então o Hub mostra contagem por grupo (estilo Sentry).

API

new Krypton(options)

| Opção | Tipo | Default | | ----------------- | -------- | --------------------------------------- | | key | string | obrigatórioingest_key do MVP | | host | string | https://api.178.105.240.224.nip.io/v1 | | flushIntervalMs | number | 5000 | | debug | boolean | false |

Métodos

  • track(type, props?) — enfileira evento (batch a cada flushIntervalMs)
  • trackRevenue(input) — envia receita imediatamente
  • captureError(err, context?) — envia erro imediatamente
  • flush() — força envio do batch agora
  • destroy() — limpa o timer interno (chame antes de encerrar o processo)

Licença

MIT