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

@union-networks/issuer

v0.2.0-alpha.10

Published

Issuer-side helpers for U-net attestation providers.

Downloads

742

Readme

@union-networks/issuer

Issuer-side helpers for U-net attestation providers.

Use this package when your service issues attestations, such as an authority, membership provider, school, event organizer, or other domain that can approve or revoke claims for a scoped U-net user.

This package is intentionally server-first. Issuer signing keys must stay in your backend environment and must never be included in frontend bundles.

Install

pnpm add @union-networks/issuer

Generate an issuer keypair

import { generateIssuerKeyPairEnv } from '@union-networks/issuer';

console.log(generateIssuerKeyPairEnv());

Store the printed values in your server environment:

UNET_ISSUER_ID=issuer:unet-issuer-example
UNET_ISSUER_KEY_ID=issuer:unet-issuer-example#main
UNET_ISSUER_PRIVATE_KEY_PEM="-----BEGIN PRIVATE KEY-----..."
UNET_ISSUER_PUBLIC_KEY_PEM="-----BEGIN PUBLIC KEY-----..."

Register your issuer key

import { registerIssuerKey } from '@union-networks/issuer';

await registerIssuerKey({
  serviceId: 'unet-issuer-example',
  issuerId: process.env.UNET_ISSUER_ID!,
  keyId: process.env.UNET_ISSUER_KEY_ID!,
  publicKeyPem: process.env.UNET_ISSUER_PUBLIC_KEY_PEM!,
  providerToken: process.env.UNET_PROVIDER_API_KEY,
});

Create a holder-facing request

In a miniapp, create or receive a scoped service session through the U-net miniapp bridge. Then ask trust-plane to open an attestation request for that scoped user:

import { createAttestationRequest } from '@union-networks/issuer';

const request = await createAttestationRequest({
  serviceId: 'unet-issuer-example',
  scopedUserId,
  requestType: 'age_over_18',
  claims: { source: 'issuer-example' },
});

Approve a request

Approval must happen on your server, because it signs with your issuer private key:

import {
  approveAttestationRequest,
  createIssuerSignerFromEnv,
} from '@union-networks/issuer';

await approveAttestationRequest({
  serviceId: 'unet-issuer-example',
  requestId,
  signer: createIssuerSignerFromEnv(),
  claims: { predicate: 'age_over_18', result: true },
  providerToken: process.env.UNET_PROVIDER_API_KEY,
});

Trust-plane verifies the issuer signature, checks that the issuer key is registered for the service/schema, anchors the commitment, and delivers the attestation to the holder.

Revoke an attestation

import { revokeAttestation, createIssuerSignerFromEnv } from '@union-networks/issuer';

await revokeAttestation({
  serviceId: 'unet-issuer-example',
  attestationHash,
  reason: 'Revoked by issuer',
  signer: createIssuerSignerFromEnv(),
  providerToken: process.env.UNET_PROVIDER_API_KEY,
});

Miniapp manifest helper

import { createIssuerMiniappManifest } from '@union-networks/issuer';

export const manifest = createIssuerMiniappManifest({
  serviceId: 'unet-issuer-example',
  name: 'U-net Issuer Example',
  provider: 'Example Issuer',
  launchUrl: 'https://your-domain.example/miniapp',
  description: 'Request attestations from the issuer.',
});

Security notes

  • Keep issuer private keys server-side.
  • Use one issuer key per provider/service.
  • Rotate keys by registering a new keyId, deploying it, then retiring the old key after pending requests are complete.
  • Browser code can create requests and display status, but approval/revocation must happen on the server.
  • U-net receives scoped IDs, issuer signatures, and attestation commitments; it should not receive unnecessary private user data.

Production issuer default

The SDK defaults to https://issuer.egress.live. You only need to pass issuerBaseUrl when targeting a local or staging trust-plane. Keep origin explicit: in browser code this is usually window.location.origin, and on the server it should be your configured public deployment origin. An origin_mismatch means the registered U-net service/domain claim does not match the current site origin.