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

@lobehub/edge-contract

v0.5.0

Published

One implementation of the edge logic shared by the LobeHub gateway, landing, cloud and lobe-chat, plus golden fixtures every copy is tested against.

Readme

@lobehub/edge-contract

Edge logic that more than one LobeHub repository has to agree on, kept in exactly one place. The gateway, landing, lobehub-cloud and lobe-chat import it instead of carrying copies.

| Subpath | What it owns | | --- | --- | | ./cache-tags | Business cache tags, raw-identifier builders, URL-segment decoding and canonical detail-tag recognition. | | ./landing-locales | The URL path prefixes landing serves, and the default (en, at the bare path). | | ./seo-topics | The discover topics landing server-renders for ?q=. | | ./request-locale | The app locale list and how a request picks one (hl, then the LOBE_LOCALE cookie, then Accept-Language). | | ./last-workspace-cookie | The LOBE_LAST_WORKSPACE cookie format. | | ./acquisition-context | The signed lh_acq first-touch cookie, landing click ids, the first-touch params landing writes on App links (FIRST_TOUCH_PARAMS) and the attribution params lifted onto /signin. | | ./app-acquisition-touch | The signed lh_acq_app cookie: the first touch of a visitor who reached sign-in without a landing click, written by the App and by the gateway on lobehub.com. |

fixtures/*.json are golden cases ({ cases: [{ name, input, expected }] }) captured from the implementations this package replaced. They are frozen: a change that fails one is a behavior change every consumer will see, so update the case on purpose, in the same commit.

Design: lobehub-gateway/docs/ryugi/specs/2026-11-06-logic-dedupe-design.md.

Cache tag identities

Import from @lobehub/edge-contract/cache-tags. marketplaceItemTag(kind, identifier) and blogPostTag(slug) take raw identifiers and encode them once. Invalid values (empty, over 255 UTF-16 code units, ASCII controls or unpaired surrogates) return undefined.

For a URL path segment, call decodeCacheTagPathSegment first. It decodes once and returns the validated raw identifier, or undefined for malformed input:

marketplaceItemTag('skill', 'owner/repo');
// landing:marketplace:skill:item:owner%2Frepo
marketplaceItemTag('skill', 'owner%2Frepo');
// landing:marketplace:skill:item:owner%252Frepo

const identifier = decodeCacheTagPathSegment('owner%2Frepo');
const tag = identifier === undefined ? undefined : marketplaceItemTag('skill', identifier);
// landing:marketplace:skill:item:owner%2Frepo

isCanonicalBlogPostTag and isCanonicalMarketplaceItemTag recognize complete, canonically encoded detail tags. They do not grant purge permission: entrypoint, deployment, token and environment policy stay with the consumer. URL-to-tag matching, origin hosts, Cloudflare calls and the gateway's torii:* cache identities also stay in the gateway.

First-touch cookies under more than one domain

The gateway writes lh_acq and lh_acq_app with Domain=lobehub.com so a sign-in that starts on lobehub.com and finishes on app.lobehub.com keeps its source; the App still writes host-only copies. A browser then sends the same name twice. Read with resolveAcquisitionContextCookie / resolveAppAcquisitionTouchCookie, which verify every copy and keep the earliest valid one; readAcquisitionContextCookie still returns only the first copy and is kept for existing callers.

The tokens are signed, not encrypted, and every *.lobehub.com host receives them, so a credential in the entry path is replaced on capture and on every read: /invite/<token> is stored as /invite/:token (see CREDENTIAL_PATH_SEGMENTS in acquisition-context.ts).

Releases: bump version, push a v<version> tag; CI publishes to npm.