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

@materia-technologies-inc/chameleon-grant

v27.0.0-preview.1

Published

Chameleon license grant tooling - Vite plugin, Rollup plugin and CLI

Downloads

212

Readme

@materia-technologies-inc/chameleon-grant

Build-time license grant tooling for Chameleon. Your build asks the licensing service for a signed grant and stamps it into the page; Chameleon's components read it at runtime.

Without a grant, Chameleon components render watermarked and disabled. Install this before your first build.

  • Node 20 or later
  • No runtime dependencies
  • A Vite plugin, a Rollup plugin and a command line — pick whichever fits your build

Install

npm install --save-dev @materia-technologies-inc/chameleon-grant

Set your organization's build token in the environment the build runs in:

export CHAMELEON_LICENSE_TOKEN="…"

It must reach a non-interactive shell. A token exported from ~/.bashrc or ~/.zshrc works when you type a command and vanishes when a script runs the same one — put it in ~/.zshenv, your CI's secret store, or wherever your shell reads for every invocation.

Pick a route

Vite

// vite.config.ts
import { chameleonGrant } from "@materia-technologies-inc/chameleon-grant/vite";

export default {
  plugins: [chameleonGrant()],
};

The grant is written into your page's <head> through transformIndexHtml, in dev and build alike.

Refuses a config that sets build.lib. Vite already knows that means a library, and a grant inside a published library is handed to everyone who installs it.

Needs an HTML page of its own, so it stamps nothing where a server renders the pages — a Blazor host, for instance, generates its own App.razor and the plugin has nothing to write into. Use the Rollup plugin there; a banner needs no page.

Rollup

// rollup.config.mjs
import { chameleonGrant } from "@materia-technologies-inc/chameleon-grant/rollup";

export default {
  plugins: [chameleonGrant({ target: "application" })],
};

The grant rides inside the bundle, as a banner at the top of each entry chunk.

target: "application" is required. Rollup cannot tell an application from a library — same inputs, same hooks, same output shape — so it asks rather than guesses, and the default is to refuse.

Command line

chameleon-grant stamp --out ./dist

Writes chameleon.grant.js. Load it from your HTML before the Chameleon bundle.

--out <directory>     Where to write the grant script (required)
--filename <name>     Output filename (default: chameleon.grant.js)
--audience <value>    Forensic project/domain identifier for the grant's aud claim
--endpoint <url>      Licensing endpoint override (development and sandbox use)

The emitted file contains a live grant: deploy it, do not commit it.

Custom integrations

Where neither plugin fits, it is two calls:

import { grantModuleCode, obtainGrant } from "@materia-technologies-inc/chameleon-grant";

const { grant } = await obtainGrant(); // the same three-tier ladder the plugins climb
const code = grantModuleCode(grant); // the line that installs it

Where the grant comes from

Your build asks for a grant down a three-tier ladder and stops at the first tier that answers:

| | | | :-- | :-- | | 1 · Service | the licensing endpoint at chameleonui.io | | 2 · Edge | when the service cannot be reached | | 3 · Cache | a grant already on this machine, up to 15 days old |

Only two things stop a build: the service answering no, and every tier being exhausted — which means offline for over a fortnight. A service that is merely unreachable does not.

There is no opt-out and no anonymous fallback, deliberately. A build that failed quietly would ship an application whose components render blank, found by whoever opens it rather than by the person who built it. Failing at the build is the louder end of the same fact.

Environment

| Variable | | | :-- | :-- | | CHAMELEON_LICENSE_TOKEN | Required. Your organization's build token. | | CHAMELEON_LICENSE_AUDIENCE | Optional. Forensic project or domain identifier. | | CHAMELEON_GRANT_ENDPOINT | Optional. Endpoint override, for development and sandbox use. Leave it unset in normal use — unset means the compiled default. |

License

See License.md.