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

@etus/telemetry-sdk

v0.1.1

Published

Embeddable SDK for Etus OSS web apps to send opt-in anonymous telemetry.

Readme

@etus/telemetry-sdk

SDK leve embarcado nas aplicações open source da Etus para enviar telemetria opt-in anônima sobre a instância self-hosted.

Pacote self-contained: zero dependências de runtime além dos built-ins do Node (crypto, fs, os, path). ESM + CJS + tipos. Node ≥ 20.

Instalação

npm install @etus/telemetry-sdk
# ou: pnpm add @etus/telemetry-sdk

Uso

Requer ETUS_TELEMETRY_ENDPOINT (ou init({ endpoint })). Sem ele, todos os métodos são no-op silencioso — ver Endpoint.

import { telemetry } from '@etus/telemetry-sdk';

// 1. no boot (uma vez) — requer ETUS_TELEMETRY_ENDPOINT, senão vira no-op
const consent = telemetry.init({
  product: 'etus-foo',
  version: '2.4.1',
  optedIn: config.telemetry?.enabled ?? null, // opt-in do operador
});

// 2. a cada 24h
await telemetry.heartbeat({
  database: { engine: 'postgres', version_major: '16' },
  usage: { active_users: 47, messages_sent: 12_034 }, // métricas dinâmicas
  features: { enabled: ['sso'], integrations: ['slack'] },
});

// 3. em transições
await telemetry.lifecycle({
  type: 'upgrade', from_version: '2.3.0', to_version: '2.4.1', feature: null,
});

Endpoint (obrigatório)

Não há endpoint default. O destino vem de init({ endpoint }) ou da env var ETUS_TELEMETRY_ENDPOINT (precedência: init > env var).

export ETUS_TELEMETRY_ENDPOINT=https://otw.etus.dev

Sem endpoint configurado, o SDK opera em no-op silencioso:

  • init() retorna { enabled: false, reason: 'no_endpoint' }.
  • heartbeat() e lifecycle() não enviam nada e retornam null.
  • inspect() continua funcionando (mostra o payload que seria enviado).

Não é erro — é o comportamento esperado quando o operador não definiu para onde enviar.

Princípios

  • Desligado por padrão. Só envia com opt-in explícito (ETUS_TELEMETRY=enabled, optedIn: true, etc.) e endpoint configurado. Respeita DO_NOT_TRACK=1 e desliga em CI.
  • Falha silenciosa. Nunca lança exceção que afete o app hospedeiro. Retry exponencial e desiste.
  • Anônimo. instance.id é hash+seed local; a seed nunca trafega.

API

| Método | Descrição | |---|---| | telemetry.init(config) | Resolve consentimento e prepara estado. Retorna { enabled, reason }. | | telemetry.heartbeat(stats?) | Envia o estado atual. No-op se opt-in off. | | telemetry.lifecycle(evt) | Envia transição (install/upgrade/feature_*). | | telemetry.inspect(stats?) | Retorna o payload que seria enviado, sem enviar. | | telemetry.isEnabled() | true se o consentimento está ligado. |

Guia completo de integração (consentimento, referência de campos, exemplos em Express/Fastify/Next.js/Python/Go): docs/05-integration-guide.md.

Política de privacidade: docs/04-privacy-policy.md.