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

@idos-network/credentials

v1.2.0

Published

idOS Credentials JavaScript SDK

Readme

idOS Credentials JavaScript SDK

This library is helper for VerifiableCredentials in idOS.

Generate a Ed25519VerificationKey2020

import { Ed25519VerificationKey2020 } from "@digitalbazaar/ed25519-verification-key-2020";

const issuer = "https://my-issuer.id/";

const key = await Ed25519VerificationKey2020.generate({
  id: `${issuer}/keys/1`,
  controller: `${issuer}/issuers/1`,
});

/* Ed25519VerificationKey2020 {
  id: "https://my-issuer.id/keys/1",
  controller: "https://my-issuer.id/issuers/1",
  revoked: undefined,
  type: 'Ed25519VerificationKey2020',
  publicKeyMultibase: 'z6MkqozXNX5bbcs17yarKiwiZN1obZ3AR6evoubA2AyRnFnq',
  privateKeyMultibase: 'zrv1yczBBXSupDwutYPAoi1fyZLi1cZTPdXHaJXLiKX68E4u1jRy7Npc4dp65hAbKuwTws79MoiAJFDs4XKscz7Sjh3'
} */

Issue a credentials

import { buildCredential } from "@idos-network/credentials/builder";

const id = "z6MkszZtxCmA2Ce4vUV132PCuLQmwnaDD5mw2L23fGNnsiX3";

const data = await buildCredential(
  {
    id: `${issuer}/credentials/${id}`,
    level: "human",
    issued: new Date("2022-01-01"),
    approvedAt: new Date("2022-01-01"),
    expirationDate: new Date("2030-01-01"),
  },
  {
    id: `uuid:${id}`,
    applicantId: "1234567890",
    inquiryId: "1234567890",
    firstName: "John",
    familyName: "Lennon",
    governmentIdType: "SSN",
    governmentId: "123-45-6789",
    dateOfBirth: new Date("1980-01-01"),
    placeOfBirth: "New York, NY",
    idDocumentCountry: "US",
    idDocumentNumber: "123456789",
    idDocumentType: "PASSPORT",
    idDocumentDateOfIssue: new Date("2022-01-01"),
    idDocumentDateOfExpiry: new Date("2025-01-01"),
    idDocumentFrontFile: Buffer.from("Front of ID document"),
    idDocumentBackFile: Buffer.from("Back of ID document"),
    selfieFile: Buffer.from("Selfie"),
    residentialAddress: {
      street: "Main St",
      houseNumber: "123",
      additionalAddressInfo: "Apt 1",
      city: "New York",
      postalCode: "10001",
      country: "US",
    },
    residentialAddressProofCategory: "Utility Bill",
    residentialAddressProofDateOfIssue: new Date("2022-01-01"),
    residentialAddressProofFile: Buffer.from("Proof of address"),
  },
  key,
  true, // Validation against schema
);

console.log(data);

Verify a credentials

import { verifyCredential } from "@idos-network/credentials";

// We have a list of issuers we trust to
const allowedIssuers = [
  {
    issuer: "https://invalid-issuer.id/",
    publicKeyMultibase: "z6MkfjxfHddp5Pf1GGUSJQ3m6PEycX2DFTVFruUMZsHPXoJx",
  },
  // Ed25519VerificationKey2020 instance, or issuer information are available
  // You don't need a privateKeyMultibase for verification!
  key,
];

const [verified, resultsByIssuer] = await verifyCredential(credential, allowedIssuers);
console.log("Verified: ", verified);
console.log("Results by issuer: ", resultsByIssuer);

Derive level

import { deriveLevel } from "@idos-network/credentials/utils";

const level = deriveLevel({
  id: "uuid:1234",
  firstName: "John",
  familyName: "Doe",
  idDocumentType: "PASSPORT",
  dateOfBirth: new Date("1990-01-01"),
  idDocumentCountry: "US",
  idDocumentNumber: "123456789",
  idDocumentFrontFile: Buffer.from("ID Document Front"),
});

// level = "basic"

Filtering and matching levels

import {
  pickHighestMatchingLevel,
  matchLevelOrHigher,
  highestMatchingCredential,
} from "@idos-network/credentials/utils";

const matched = matchLevelOrHigher("basic", ["liveness"], "basic+liveness");
// matched = true

const matched = matchLevelOrHigher("basic", ["liveness+email"], "basic+liveness");
// matched = false

const matched = matchLevelOrHigher("basic", ["liveness+email"], "plus+liveness");
// matched = true

const pickedLevel = pickHighestMatchingLevel(
  ["basic+liveness", "plus+liveness+email", "plus+liveness+email+phoneNumber"],
  "plus",
  ["liveness", "email"],
);
// pickedLevel = plus+liveness+email+phoneNumber

const pickedCredential = highestMatchingCredential([...idOSCredentials], "basic", {
  addons: ["email", "liveness"],
  publicNotesConstraint: {
    status: "approved",
    type: "kyc",
  },
});
// pickedCredential => for example plus+email+liveness etc...
// don't forget to verify credentials signature before usage!