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

@kodentuzo/spotkit

v0.5.0

Published

Connect an app to its slots, in production and on your machine: who the user is, accounts, the legal facts, counting visits, and the spotkit command

Readme

Spotkit

Connect an app to its slots, in production and on your machine.

State: the library and the CLI (spotkit dev, spotkit new) are at 0.5.0, the release on npm.

Every Spotcraft instance runs eight slots, always: accounts, analytics, mail, legal, registry, backups, monitoring and sync. Spotkit is the app's side of them, in two parts:

  • the library, in each app. By default it talks only to /_spotcraft/* on the app's own domain;
  • the CLI, on your machine. spotkit dev runs the same slots locally.

An app that uses Spotkit writes no auth, privacy or analytics plumbing of its own. Spotkit is optional: it only wraps what the slots' contracts say, so an app can do the same by hand.

What it does

  • Knows the user: kit.user(request) returns the user behind a request, checked against the accounts slot's keys (Spotpass), with one call per session.
  • Accounts: signUp, signIn, signOut, verifyEmail, requestPasswordReset, resetPassword and twoFactor call the matching Spotpass 0.2 routes, and each service's base URL is an option (authUrl, legalUrl, analyticsUrl), so an app can use the services without Spotcraft.
  • Nothing stored before an explicit action: storage is off by default, behind one Spotkit switch (storageSwitch). No cookie, no guest account and nothing on the device until the app turns it on, at the moment the person does something that asks for it, such as "Continue as guest" (the entry screen also offers "Sign in"). Until then signUp() and signIn() refuse. On the next visit the session cookie shows the switch was on (the contract).
  • Feeds the legal pages: legalFacts() on the server and legal() in the browser return who runs the app and what it processes (Spotliance), so no owner's details are committed.
  • Gives users their data: exportMe() and deleteMe() for the server's side, and localData() for what the browser keeps. A delete reaches every app on the instance.
  • Counts visits, one way: analytics() loads the analytics slot's script (Spotless) and refuses event data that could identify someone. There is no consent and no opt-out, since nothing is stored on the device, and no app has a setting to switch counting off: an app is counted once it loads the script.
  • Reads the wiring: config() returns where each of the eight slots answers.
  • The CLI: spotkit dev and spotkit new, moved here from Spotcraft's spotcraft command. spotkit dev runs Postgres, Spotpass and Mailpit locally, with small stand-ins for analytics and legal. It reads spotkit.json, which replaces spotcraft.json.
  • Small helpers: the client's address behind the proxy, and a health endpoint.

Offline-first apps follow one recipe, with the server as the authority: docs/offline-first.md. Spotkit covers the user's rights over the data, and doesn't wrap the recipe itself.

How to swap it

Spotkit is a convenience, never something the platform needs. Call the slots' contracts by hand, or use another library; Spotcraft doesn't know which. An app can also skip a slot and call something else (say, Clerk for accounts); the slot stays, unused.

Use

npm install @kodentuzo/spotkit
import { spotkit } from '@kodentuzo/spotkit'

const kit = spotkit() // reads AUTH_URL, AUTH_ISSUER and AUTH_JWKS_URL
const user = await kit.user(request) // { id, isAnonymous } or null

On your machine, pnpm exec spotkit dev starts the slots (it needs Docker) and fills .env.

The full guide is in docs/guide.md.

How it's built

  • Two entry points: one for the server (one dependency, jose) and one for the browser with no dependencies and no Node APIs. The CLI's own dependency, pg, is only loaded by spotkit. Web Request, Response and Headers only, so it fits any framework. There are no framework adapters.
  • Contract first: it only wraps what the slots' contracts say. Its own contract is its types, the paths it uses and spotkit.json: docs/contract.md.
  • Published with provenance from CI with npm trusted publishing; no tokens stored.

Stack: TypeScript, Web APIs, jose, pg (CLI), Node's test runner, Biome, GitHub Actions. Used by Sokobanko and Spotstrap's blocks. Spotstrap 0.4 needs Spotkit 0.5 (^0.5.0), and the two ship in the same step.

Links

MIT