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

@luminaryworks/entitlement-client

v0.2.6

Published

LuminaryWorks Entitlement NestJS client — TTL cache, ENTITLEMENT_MODE, stable DTO/errors

Readme

@luminaryworks/entitlement-client

NestJS client for the central Entitlement service.

Modes (ENTITLEMENT_MODE)

| Mode | Behavior | |------|----------| | off | Do not call central; local decision path (rollback) | | shadow_read | Dual-read: local decision still wins; log diffs | | enforce | Central result is authoritative; fail closed on uncertainty |

Usage

import { EntitlementClientModule, EntitlementClient } from "@luminaryworks/entitlement-client";

EntitlementClientModule.forRoot({
  baseUrl: process.env.ENTITLEMENT_BASE_URL!,
  mode: (process.env.ENTITLEMENT_MODE as "off" | "shadow_read" | "enforce") ?? "off",
  serviceApiKey: process.env.ENTITLEMENT_SERVICE_API_KEY,
  cacheTtlMs: 60_000,
  // Private deployment: public keys only
  licensePublicKeys: process.env.ENTITLEMENT_LICENSE_PUBLIC_KEYS
    ? JSON.parse(process.env.ENTITLEMENT_LICENSE_PUBLIC_KEYS)
    : undefined,
});

Guard order in products:

LuminaryJwtAuthGuard → EntitlementGuard(feature) → PermissionGuard(Casbin)

Local License verify

const result = await client.verifyLicenseLocal(signedLicense, {
  productCode: "dataluminary",
  featureCode: "dashboard.export",
  allowGrace: true, // false on first install with no prior successful cache
});
// result.casbinBypass === false — always; License is commercial entitlement only

Commercial rights are never read from JWT. Partner redemption and trial notify are server-side; products consume /v1/entitlements and local License verify for offline private deployments.

Gauge quotas (resource counts / bytes) use client.allocate({ resourceId, amount }) and client.release({ resourceId }). Counter quotas (API / monthly / voice) keep client.consume(). Do not send subjectId in the JSON body; the client always binds the subject via the verified token or X-Act-As-Subject.

Module format (Nest backends)

Source TypeScript uses ES import / export. The published dist/ is compiled to CommonJS (require / module.exports) because NestJS product backends still load this package via CommonJS.

src/*.ts   →  import / export
dist/*.js  →  require / module.exports   (intentional for Nest)

Do not assume “Node 24 = must be ESM-only”. Node 24 supports both; Nest 10/11 + typical nest start remain CJS-first. A dual ESM+CJS publish can be added later without dropping CJS.

After shared package changes, consumers using file: deps must refresh:

# from LuminaryWorks MetaRepo
pnpm ent:client:sync

This rebuilds dist/ (including trial.js) and forces pnpm to replace stale content-addressable copies. Otherwise index.js may require('./trial') while trial.js is missing in node_modules.