Skip to content

Latest commit

Β 

History

141 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Identity Common - TypeScript

TypeScript Apache 2.0 License

Overview Β |Β  Packages Β |Β  Getting Started Β |Β  Supported Environments Β |Β  Contributing Β |Β  License


Overview

To avoid reinventing the wheel, many identity projects share common needs for data types and utility functions. Identity Common TypeScript provides a shared library of TypeScript types and utilities for identity-related projects, promoting consistency and reducing duplication across the ecosystem.

Goals

  • πŸͺΆ Lightweight: Minimal dependencies to keep bundle sizes small
  • 🌐 Platform Agnostic: Works in Node.js, browsers, and React Native
  • πŸ”„ Reusable: Common utilities shared across identity solutions
  • 🀝 Interoperable: Ensures compatibility between different identity projects

Project Categories

The project is organized into two main categories:

Core Identity Utilities

Generic, reusable utilities that can be used across any identity solution:

Package Description Status
@owf/identity-common Base types, base64url utilities, and JWT decoding βœ… Available
@owf/crypto Web Crypto API wrappers + SHA hash functions (@noble/hashes) βœ… Available
@owf/token-status-list Status list bitstring handling, JWT and CWT/CBOR transport βœ… Available
@owf/jose JOSE/JWT implementation with common validation methods πŸ“‹ Planned
@owf/cose COSE/CWT implementation with common validation methods πŸ“‹ Planned
@owf/x509 X.509 certificate parsing, creation, and verification πŸ“‹ Planned

EUDI-Specific Tools

Tools specific to the European Digital Identity (EUDI) Wallet ecosystem:

Package Description Status
@owf/eudi-lote ETSI TS 119 602 Lists of Trusted Entities (LoTE) βœ… Available
@owf/eudi-tl ETSI TS 119 612 XML Trusted Lists parsing and verification βœ… Available
@owf/eudi-wrprc ETSI TS 119 475 Wallet-Relying Party Registration Certificates βœ… Available
@owf/eudi-attestation-schema TS11 Catalogue of Attestations SchemaMeta βœ… Available
@owf/eudi-certificates Registration and access certificate verification πŸ“‹ Planned
@owf/eudi-sca TS12 Strong Customer Authentication Payments according to the latest to-be-added ARF In Progess

Note: While the EUDI Wallet is built on open standards (OpenID4VC, SD-JWT VC), it requires specific extensions for Trust, Payments, and document signing that are better suited in dedicated packages.


Packages

@owf/identity-common

@owf/identity-common version

Base types (JwtPayload, JsonWebKey, Signer, Verifier, Hasher), base64url encode/decode, and JWT decoding.

npm install @owf/identity-common

πŸ“– View package documentation

@owf/crypto

@owf/crypto version

Web Crypto API wrappers for signing, hashing, salt generation, and ES256/384/512 key pairs, plus SHA-256/384/512 hash functions powered by @noble/hashes.

npm install @owf/crypto

πŸ“– View package documentation

@owf/token-status-list

@owf/token-status-list version

Status list implementation with bitstring handling, compression/decompression, JWT transport layer, and CWT/CBOR transport layer for Token Status Lists (draft-ietf-oauth-status-list).

npm install @owf/token-status-list

πŸ“– View package documentation

@owf/eudi-lote

@owf/eudi-lote version

SDK for creating, signing, and validating Lists of Trusted Entities (LoTE) per ETSI TS 119 602.

npm install @owf/eudi-lote

πŸ“– View package documentation

@owf/eudi-tl

@owf/eudi-tl version

Parsing, validation, and XAdES signature verification for ETSI TS 119 612 XML Trusted Lists, exposing normalized trust anchors. The XML counterpart of @owf/eudi-lote.

npm install @owf/eudi-tl

πŸ“– View package documentation

@owf/eudi-wrprc

@owf/eudi-wrprc version

SDK for creating, signing, and validating Wallet-Relying Party Registration Certificates (WRPRC) per ETSI TS 119 475 v1.2.1.

npm install @owf/eudi-wrprc

πŸ“– View package documentation

@owf/eudi-attestation-schema

@owf/eudi-attestation-schema version

SDK for creating, signing, and validating attestation schema metadata (SchemaMeta) per the EUDI TS11 Catalogue of Attestations specification.

npm install @owf/eudi-attestation-schema

πŸ“– View package documentation


Getting Started

Installation

Install the packages you need:

# Using npm
npm install @owf/identity-common

# Using pnpm
pnpm add @owf/identity-common

# Using yarn
yarn add @owf/identity-common

Development Setup

This monorepo uses pnpm for package management and Turborepo for task orchestration.

# Clone the repository
git clone https://github.com/openwallet-foundation-labs/identity-common-ts.git
cd identity-common-ts

# Install dependencies (requires pnpm)
pnpm install

# Build all packages
pnpm build

# Run all tests
pnpm test

Turborepo

All build and test tasks run through Turborepo, which provides:

  • Caching β€” tasks whose inputs haven't changed are skipped entirely (a cached full run completes in ~15ms)
  • Parallelism β€” independent packages build and test concurrently
  • Correct ordering β€” packages are always built before the packages that depend on them

Task pipeline

Task Depends on What it does
build upstream build Compiles each package with tsdown (ESM + CJS + .d.ts)
test upstream build Runs vitest tests for each package
types:check upstream build Type-checks the workspace with tsc --noEmit
esm:check local build Validates ESM import paths
lint β€” Linting (no build prerequisite)

Run any task across all packages:

pnpm build          # turbo run build
pnpm test           # turbo run test

# Scope to a single package
npx turbo run build --filter=@owf/identity-common
npx turbo run test  --filter=@owf/crypto

The first run executes everything. Subsequent runs that find no changed inputs print FULL TURBO and finish instantly.

Cache details

Turbo computes a hash for each task from its input files (src/**, package.json, tsconfig.json), the global config (tsconfig.json, vite.config.js), and the pnpm lockfile. If the hash matches a previously-stored result the task is restored from .turbo/cache/ without re-running.

The .turbo/ directory is intentionally not committed (.gitignore) β€” every developer gets their own local cache.


Supported Environments

This library is platform agnostic and supports:

  • βœ… Node.js (>=20)
  • βœ… Browsers (modern browsers with ES2020 support)
  • βœ… React Native

Requirements

Your environment must provide:

  • URL and URLSearchParams implementations
  • A global fetch implementation (or provide it via callbacks)

Platform-Agnostic Design

Because these libraries are platform agnostic, cryptographic operations and other platform-specific functionality must be provided via callbacks:

import { someFunction } from '@owf/identity-common'

// Provide platform-specific implementations
const result = await someFunction({
  crypto: {
    sha256: async (data) => { /* your implementation */ },
    randomBytes: (length) => { /* your implementation */ },
  },
  fetch: globalThis.fetch, // if not globally available
})

Related Projects

This library is designed to work with and support other OpenWallet Foundation projects:


Contributing

We welcome contributions! Whether you're:

  • πŸ› Reporting bugs
  • πŸ’‘ Suggesting features
  • πŸ“ Improving documentation
  • πŸ”§ Submitting code changes

Please read our Contributing Guide to get started.

Adding a New Package

A script is provided to scaffold a new package with the correct structure, build config, and Turborepo wiring already in place:

pnpm create-package <name>           # e.g. jose
pnpm create-package <name> --eudi   # prefixes with eudi-

See the guide for adding packages for details.


License

This project is licensed under the Apache License Version 2.0 (Apache-2.0).

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages