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

@premai/prem-rs

v0.2.3

Published

Hardware attestation SDK for JavaScript and TypeScript. Cryptographically verifies AMD SEV-SNP, Intel TDX, and NVIDIA GPU attestations from an [attestation server](https://github.com/prem-research/reticle) — runs in Node.js, Bun, Deno and the browser via

Readme

prem-rs

Hardware attestation SDK for JavaScript and TypeScript. Cryptographically verifies AMD SEV-SNP, Intel TDX, and NVIDIA GPU attestations from an attestation server — runs in Node.js, Bun, Deno and the browser via WASM.

Install

npm install @premai/prem-rs

Quick start

import { ClientBuilder } from "@premai/prem-rs";

const client = new ClientBuilder("https://attestation.example.com")
  .build();

// End-to-end attestation: discovers modules, generates nonces,
// verifies cryptographic signatures and certificate chains
const result = await client.attest();

console.log("CPU:", result.modules().cpu());   // CpuModule.Sev or CpuModule.Tdx
console.log("GPU:", result.modules().gpu());   // GpuModule.Nvidia or undefined

API

ClientBuilder

Creates and configures a Client instance.

const client = new ClientBuilder(url)
  .with_authorization("Bearer <token>")  // optional: set Authorization header
  .with_kds(new Kds(kdsUrl))             // optional: custom AMD KDS cache
  .with_pcs(new Pcs(pcsUrl))             // optional: custom Intel PCS cache
  .build();

Client

High-level (recommended)

These methods handle nonce generation, request, and full cryptographic verification in a single call:

| Method | Description | |---|---| | client.attest(query?) | Full attestation of all available modules (CPU + GPU) | | client.attest_sev(query?) | AMD SEV-SNP attestation only | | client.attest_tdx(query?) | Intel TDX attestation only | | client.attest_nvidia(query?) | NVIDIA GPU attestation only |

Low-level

These methods fetch and parse attestation evidence (discouraged) — useful when you need to inspect raw data or implement custom validation:

| Method | Description | |---|---| | client.request_modules(query?) | List available attestation modules on the server | | client.request_sev(nonce, query) | Fetch raw SEV-SNP attestation report | | client.request_tdx(nonce, query) | Fetch raw TDX quote | | client.request_nvidia(nonce, query) | Fetch raw NVIDIA EAT/JWT token |

QueryParams

Pass custom query parameters to the attestation server. The nonce key is reserved and will throw if used.

const query = new QueryParams()
  .with("model", "my-model")
  .with("version", "1.0");

await client.attest(query);

Sub-module access

Lower-level types from the attestation modules are available under namespaces:

import { nvidia, sev } from "@premai/prem-rs";

// NVIDIA: manual token parsing and verification
const keychain = await nvidia.fetch_keychain();
const token = nvidia.EATToken.parse(rawJwt);
const claims = token.verify(keychain);
claims.validate(nonce);

// AMD SEV-SNP: manual certificate chain verification
const kds = new sev.Kds("https://kcds.prem.io");
const chain = await kds.fetch_certificates(attestation);
attestation.verify(chain, nonce);

Memory management

WASM objects are not garbage-collected automatically. Call .free() when done, or use using (TypeScript 5.2+) for automatic disposal:

using client = new ClientBuilder(url).build();
using result = await client.attest();
// automatically freed at end of scope

Examples

  • Bun — minimal CLI attestation
  • Vite — browser UI with attestation status

License

See LICENSE.