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

@lobsterhoney/sdk

v0.2.0

Published

Thin browser metrics loader

Readme

@lobsterhoney/sdk

Thin browser metrics loader. A tiny bootstrap that fetches your per-site configuration at runtime and hands off to a versioned module served from your metrics endpoint. No configuration lives in this package.

Install

npm install @lobsterhoney/sdk

Or load from your endpoint via a script tag.

Usage

Script tag (auto-init)

<script src="https://your-endpoint.example.com/loader.js" data-key="your-site-key"></script>

The loader auto-initializes when data-key is present. The endpoint is inferred from the script's src origin.

Programmatic

import { init } from '@lobsterhoney/sdk';

await init({
  key: 'your-site-key',
  endpoint: 'https://your-endpoint.example.com',
});

Configuration

interface InitOptions {
  key: string;         // Site key (8-128 chars, alphanumeric + _ -)
  endpoint?: string;   // Endpoint origin; inferred from the script src if omitted
}

Content Security Policy

The loader fetches its runtime configuration from your endpoint and then loads a module from that same origin. If your site sends a Content-Security-Policy header, allow your endpoint origin in both directives:

Content-Security-Policy:
  script-src  'self' https://your-endpoint.example.com;
  connect-src 'self' https://your-endpoint.example.com;
  • connect-src covers the runtime config fetch and the metrics POST.
  • script-src covers the dynamically imported runtime module.

Replace your-endpoint.example.com with the endpoint origin issued at onboarding. No blob: or 'unsafe-eval' is required — the loader imports a plain HTTPS module URL and never evaluates strings.

How it loads

  • The loader requests your site config from the endpoint over HTTPS.
  • The runtime module URL in that config is validated to be HTTPS and on the endpoint origin (or a subdomain of it) before it is imported.
  • The module URL is versioned and immutable, so it is cached long-term and never changes for a given version.

Security notes

  • Zero runtime dependencies; ships ESM, UMD, and a minified UMD bundle for CDN <script> use.
  • Endpoint is origin-validated before any request: it must be HTTPS and either same-origin or a subdomain of the configured base. A mismatched endpoint is rejected.
  • Site-key format is validated on auto-init (8-128 chars, alphanumeric plus _/-).
  • No eval, no new Function, no blob: — the runtime module is loaded by a native dynamic import() of a validated HTTPS URL.
  • Auto-init failures are swallowed so they never surface in your page's error handlers.

License

MIT