Credentials

Issue, hold, and verify W3C Verifiable Credentials with a pure JavaScript SDK. No native dependencies, no server required.

The credential lifecycle

Every credential follows three stages: Issue, Hold, and Verify.

  1. Issue — An issuer signs claims about a subject, producing a Verifiable Credential.
  2. Hold — The subject stores the credential in a wallet or vault.
  3. Verify — A verifier checks the signature, expiration, issuer, and optional revocation status.

The SDK

The @attestto-com/vc-sdk package implements the full lifecycle.

Terminal
 npm install @attestto-com/vc-sdk 

Highlights

  • W3C VC Data Model v2.0 — fully compliant credential structure and JSON-LD contexts.
  • Zero native dependencies — pure JavaScript cryptography via @noble/curves. Works in Node.js, Deno, Bun, and the browser.
  • Ed25519 + ES256 — two signature algorithms out of the box.
  • Pluggable schema system — extend with domain-specific credential types and JSON-LD contexts.
  • DID-agnostic — works with any DID method (did:web, did:sns, did:key, did:pki).

Quick example

overview.ts
 import { VCIssuer, VCVerifier, generateKeyPair } from '@attestto-com/vc-sdk'

// Generate keys and issue a credential
const keys = generateKeyPair()
const issuer = new VCIssuer({ did: 'did:web:example.com', privateKey: keys.privateKey })

const vc = await issuer.issue({
  type: 'ProfessionalLicense',
  subjectDid: 'did:web:holder.example.com',
  claims: { license: 'Engineering', number: 'ENG-2026-001' },
})

// Verify it
const verifier = new VCVerifier()
const result = await verifier.verifyWithKey(vc, keys.publicKey, 'Ed25519')
console.log(result.valid) // true 
💡
No server needed. The SDK runs entirely client-side. Keys are generated in-process and credentials are self-contained — no API calls, no blockchain writes required for basic issuance and verification.

Documentation