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

prismatik-hub-sdk

v0.1.1

Published

Official TypeScript SDK to integrate TechAssistia (and any on-prem app) with the Prismatik Hub: license validation, AI keys distribution, webhooks, payments, telemetry.

Readme

prismatik-hub-sdk

TypeScript SDK pour intégrer une instance on-prem (TechAssistia Solution ou app tierce) au Prismatik Hub : validation de licences, distribution de clés AI, webhooks signés HMAC, proxy paiement KKiaPay, télémétrie.

Installation

npm install prismatik-hub-sdk

Démarrage rapide

import { PrismatikHub } from "prismatik-hub-sdk";

const hub = new PrismatikHub({
  apiKey: process.env.PRISMATIK_API_KEY!,         // ph_live_xxxxx
  // hubUrl est optionnel — par défaut: https://www.techassistia.com
});

// Au premier boot : activer la licence sur cette instance
const activation = await hub.license.activate(
  process.env.LICENSE_KEY!,        // ph_lic_xxxxx
  fingerprint,                      // ex: machine-id stable
);
if (!activation.success) throw new Error(activation.reason);

// À chaque démarrage / périodiquement : valider
const v = await hub.license.validate(fingerprint);
if (!v.valid) throw new Error("License invalid: " + v.reason);

// Vérifier une feature avant un appel
if (await hub.license.checkFeature("itsm")) {
  // ... module ITSM activé
}

// Vérifier une limite
const check = await hub.license.checkLimit("users", currentUserCount);
if (!check.allowed) {
  return res.status(403).json({ error: "Limite utilisateurs atteinte" });
}

Modules disponibles

| Module | Méthodes | |---|---| | license | activate, validate, checkFeature, checkLimit, getServiceLevel | | ai | getProviderKeys, reportUsage, getQuota | | webhooks | register, list, delete, verifySignature | | payments | initiate, verify | | relay | send, poll, acknowledge | | telemetry | report, heartbeat |

Authentification

Le SDK envoie le header Authorization: Bearer ph_live_<key> sur tous les appels. Génère ta clé API depuis le portail Prismatik Hub (/api-keys).

Configuration

new PrismatikHub({
  apiKey: "ph_live_...",
  hubUrl: "https://www.techassistia.com",   // défaut, à override uniquement pour staging/test
  timeout: 30_000,                           // ms, défaut 30s
  retries: 2,                                // défaut 2 (exponentiel: 1s, 2s)
});

Gestion des erreurs

import { PrismatikHub, PrismatikError } from "prismatik-hub-sdk";

try {
  await hub.license.validate();
} catch (err) {
  if (err instanceof PrismatikError) {
    console.error(`Hub error ${err.status}: ${err.message}`);
  }
}

Vérification de signature webhook

const ok = hub.webhooks.verifySignature(
  rawBody,                         // body en string brut
  req.headers["x-prismatik-signature"]!,  // "t=...,v1=..."
  webhookSecret,                   // celui retourné lors de register()
);

Licence

UNLICENSED — usage interne TechAssistia / partenaires Prismatik.