# @sd-jwt/sd-jwt-vc

> SD-JWT VC (draft-ietf-oauth-sd-jwt-vc) implementation in TypeScript

Latest version **0.23.0** (published 2026-10-17) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @sd-jwt/sd-jwt-vc
pnpm add @sd-jwt/sd-jwt-vc
yarn add @sd-jwt/sd-jwt-vc
bun add @sd-jwt/sd-jwt-vc
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.23.0 |
| Published | 2026-10-17 |
| First published | 2024-02-28 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 112 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 8 |
| Maintainers | openwalletfoundation |

## Links

- npm: https://www.npmjs.com/package/@sd-jwt/sd-jwt-vc
- Repository: https://github.com/openwallet-foundation-labs/identity-common-ts
- Homepage: https://github.com/openwallet-foundation-labs/identity-common-ts/tree/main/packages/sd-jwt-vc
- Issues: https://github.com/openwallet-foundation-labs/identity-common-ts/issues
- npm.io page: https://npm.io/package/@sd-jwt/sd-jwt-vc

## Dependencies (4)

- [zod](https://npm.io/package/zod.md) ^4.6.5
- [@sd-jwt/core](https://npm.io/package/@sd-jwt/core.md) 0.23.0
- [@owf/identity-common](https://npm.io/package/@owf/identity-common.md) ^0.5.0
- [@owf/token-status-list](https://npm.io/package/@owf/token-status-list.md) ^0.5.0

## Recent versions

- 0.23.0 (latest) — 2026-10-17
- 0.23.1-alpha-20261019165353 (alpha) — 2026-10-19
- 0.20.2-next.0 (next) — 2026-08-29
- 0.23.1-alpha-20261019164905 — 2026-10-19
- 0.23.1-alpha-20261019114814 — 2026-10-19
- 0.23.1-alpha-20261019101907 — 2026-10-19
- 0.23.1-alpha-20261019093947 — 2026-10-19
- 0.23.1-alpha-20261019093757 — 2026-10-19
- 0.23.1-alpha-20261019081235 — 2026-10-19
- 0.23.1-alpha-20261018124429 — 2026-10-18
- 0.23.1-alpha-20261017152632 — 2026-10-17
- 0.23.0-alpha-20261017134058 — 2026-10-17
- 0.23.0-alpha-20261017132420 — 2026-10-17
- 0.23.0-alpha-20261016174215 — 2026-10-16
- 0.23.0-alpha-20261016095738 — 2026-10-16
- … 252 more at https://npm.io/package/@sd-jwt/sd-jwt-vc/versions

## README

# @sd-jwt/sd-jwt-vc

[![npm version](https://img.shields.io/npm/v/@sd-jwt/sd-jwt-vc)](https://npmjs.com/package/@sd-jwt/sd-jwt-vc)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/openwallet-foundation-labs/identity-common-ts/blob/main/LICENSE)

Implementation of [SD-JWT-based Verifiable Credentials (SD-JWT VC) — draft-ietf-oauth-sd-jwt-vc-15](https://www.ietf.org/archive/id/draft-ietf-oauth-sd-jwt-vc-15.html), built on top of [`@sd-jwt/core`](../sd-jwt-core) ([RFC 9901](https://www.rfc-editor.org/rfc/rfc9901.html)).

## Installation

```bash
# Using npm
npm install @sd-jwt/sd-jwt-vc

# Using pnpm
pnpm add @sd-jwt/sd-jwt-vc

# Using yarn
yarn add @sd-jwt/sd-jwt-vc
```

## Usage

Here's a basic example of how to use this library:

```typescript
import type { DisclosureFrame } from '@sd-jwt/core';

// identifier of the issuer
const iss = 'University';

// issuance time
const iat = Math.floor(Date.now() / 1000); // current time in seconds

//unique identifier of the schema
const vct = 'University-Degree';

// Issuer defines the claims object with the user's information
const claims = {
  firstname: 'John',
  lastname: 'Doe',
  ssn: '123-45-6789',
  id: '1234',
};

// Issuer defines the disclosure frame to specify which claims can be disclosed/undisclosed
const disclosureFrame: DisclosureFrame<typeof claims> = {
  _sd: ['firstname', 'lastname', 'ssn'],
};

// Issuer issues a signed JWT credential with the specified claims and disclosure frame
// returns an encoded JWT
const credential = await sdjwt.issue(
  { iss, iat, vct, ...claims },
  disclosureFrame,
);

// Holder may validate the credential from the issuer
const valid = await sdjwt.validate(credential);

// Holder defines the presentation frame to specify which claims should be presented
// The list of presented claims must be a subset of the disclosed claims
const presentationFrame = { firstname: true, ssn: true };

// Holder creates a presentation using the issued credential and the presentation frame
// returns an encoded SD JWT.
const presentation = await sdjwt.present(credential, presentationFrame);

// Verifier can verify the presentation using the Issuer's public key
const verified = await sdjwt.verify(presentation);
```

## Examples

Runnable examples are available in [`examples/sd-jwt/sd-jwt-vc`](../../examples/sd-jwt/sd-jwt-vc). Run them from the repository root:

```bash
pnpm tsx examples/sd-jwt/sd-jwt-vc/basic.ts
```

See the [SD-JWT examples overview](../../examples/sd-jwt/README.md) for the full list.

## Dependencies

- [@sd-jwt/core](https://www.npmjs.com/package/@sd-jwt/core)
- [@owf/token-status-list](https://www.npmjs.com/package/@owf/token-status-list)
- [zod](https://www.npmjs.com/package/zod)

## Platform Support

This library is **platform agnostic** and works in:

- ✅ Node.js (>=20)
- ✅ Browsers (modern browsers with ES2020 support)
- ✅ React Native

A global `TextEncoder` and `TextDecoder` must be available. See the [React Native notes](../identity-common/README.md#react-native) if you need a polyfill.

Cryptographic operations (signing, verification, hashing, salt generation) are provided as callbacks. [`@owf/crypto`](https://github.com/openwallet-foundation-labs/identity-common-ts/tree/main/packages/crypto) provides Web Crypto based implementations.

## Contributing

See the [Contributing Guide](https://github.com/openwallet-foundation-labs/identity-common-ts/blob/main/CONTRIBUTING.md) for details on how to contribute to this project.

## License

This project is licensed under the [Apache License Version 2.0](https://github.com/openwallet-foundation-labs/identity-common-ts/blob/main/LICENSE) (Apache-2.0).

---
_Source: https://npm.io/package/@sd-jwt/sd-jwt-vc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
