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

@mindalike/platform-contracts

v1.0.3

Published

Shared identity, CSRF, origin, cookie, and request-metadata contracts for all Mindalike workers. Single source of truth extracted from the platform core (landing-page).

Readme

@mindalike/platform-contracts

Single source of truth for the platform identity, CSRF, origin, cookie, and response-envelope contracts shared by every Mindalike worker (landing-page, netchat, mindavibe, orbit).

Rules:

  • landing-page (core) MINTS tokens; all siblings VERIFY ONLY. Both sides use this same code with the same secret value.
  • Contracts contain ZERO secrets. The secret VALUE lives in each repo's .dev.vars / wrangler secrets, never here.
  • Breaking changes = major version bump + coordinated sibling upgrades.

Install (in a worker repo)

pnpm add @mindalike/platform-contracts

Wrangler inlines the imported code into the worker bundle at deploy — there is no runtime dependency, no network hop, no hosting of this package needed.

Usage — verifying side (netchat / mindavibe / orbit)

import { PlatformJwt, extractAccessToken } from '@mindalike/platform-contracts';

// once per isolate:
const jwt = new PlatformJwt(env.JWT_SECRET); // same secret VALUE as the core

const token = extractAccessToken(request);
if (!token) return new Response('Unauthorized', { status: 401 });

const payload = await jwt.verifyToken(token);
if (!payload) return new Response('Unauthorized', { status: 401 });

// Revocation is a SESSION-layer check on top of signature verification.
// Siblings with DB access check sessions.isRevoked for payload.sessionId;
// see landing-page/worker/database/services/AuthService.ts for reference.

Usage — minting side (landing-page core only)

import { PlatformJwt } from '@mindalike/platform-contracts';

const jwt = new PlatformJwt(env.JWT_SECRET);
const { accessToken, expiresIn } = await jwt.createAccessToken(
	userId, email, sessionId,
	3 * 24 * 3600, // sessionTTL
);
// set accessToken cookie (HttpOnly; Secure; SameSite=Lax; Path=/)

CSRF

import { validateCsrfToken, buildCsrfSetCookie } from '@mindalike/platform-contracts';

if (!validateCsrfToken(request)) {
	return fail('csrf_violation', 'CSRF validation failed', 403);
}
// seed the cookie on safe methods:
buildCsrfSetCookie(response, generateCsrfToken());

Origins

import { getAllowedOrigins, isOriginAllowed } from '@mindalike/platform-contracts';

const origins = getAllowedOrigins(env); // CUSTOM_DOMAIN + EXTRA_ALLOWED_ORIGINS (+ localhost in dev)

Adding a new cross-origin client host = one line in that worker's env var EXTRA_ALLOWED_ORIGINS, no code change.

Envelope

import { ok, fail } from '@mindalike/platform-contracts';
return ok(data);
return fail('quota_exceeded', 'no credits', 402);

Cookie contract (constants)

ACCESS_COOKIE_NAME (accessToken), legacy read-only names auth_token/jwt, extraction priority Authorization header → accessToken → legacy. See claims.ts.

Publishing

Version tags drive CI:

# bump version in package.json first, then:
git tag platform-contracts-v1.0.1
git push origin platform-contracts-v1.0.1

Requires NPM_TOKEN secret in this GitHub repo. CI runs lint+tests before publish and refuses if tag ≠ package.json version.

Local development inside worker repos

To work against an unreleased version, use pnpm's file protocol:

"@mindalike/platform-contracts": "file:../packages/platform-contracts"

Switch back to the registry version before deploying.