Standalone TypeScript reference implementation for Universal Manifest.
npm install @universalmanifest/typescriptimport { create, sign, verify, resolve } from '@universalmanifest/typescript'
const unsigned = create({
manifestVersion: '0.2',
id: 'urn:um:example:minimal',
subject: 'did:example:alice',
issuedAt: '2026-01-01T00:00:00Z',
expiresAt: '2027-01-01T00:00:00Z',
})
const signed = sign(unsigned, {
privateKey: process.env.UM_PRIVATE_KEY_PEM,
created: '2026-01-01T00:00:00Z',
})
const verifyResult = verify(signed)
if (!verifyResult.ok) throw new Error(verifyResult.error)
const resolved = await resolve(signed)
console.log(resolved['@id'])-
create(input)Creates a v0.1 manifest or unsigned v0.2 draft payload. -
validate(value, options?)Structural validation for v0.1 and v0.2 manifests (with optional freshness checks). -
sign(unsignedV02, options)Signs v0.2 manifests using Ed25519 + JCS canonicalization. -
verify(value, options?)Verifies v0.2 signatures (and optional freshness checks). -
resolve(input, options?)Resolves a manifest from an inline object, registry, custom fetch callback, or by default via HTTP (https://myum.net/{UMID}).
npm run build
npm test
npm run conformanceConformance details and report output format are documented in CONFORMANCE.md.
examples/create-and-sign.tsexamples/verify-manifest.tsexamples/resolve-umid.ts
This repository is intended to be copied as a starter implementation.
Recommended template workflow:
- Fork this repository.
- Keep
src/API shape and tests intact while adapting internals to your runtime requirements. - Keep
tests/conformance/adapter.mjscontract-compatible so you can continue running the UM conformance suite. - Run
npm testandnpm run conformancein CI for every change.