2.0.0 • Published 1 month ago

@digitalcredentials/vc-data-model v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

Verifiable Credentials Data Model (@digitalcredentials/vc-data-model)

Build status NPM Version

Typescript types for the W3C Verifiable Credentials Data Model.

Table of Contents

Background

If you're implementing the Verifiable Credential specification in Typescript, chances are that you're using a type definition for VerifiableCredentials and VerifiablePresentations. Many VC-related projects (Sphereon's Veramo, LEF's LearnCard, Transmute's Verifiable Data) include the type definitions in their monorepos.

We saw a niche for a standalone library that exported just the type definitions, hence this repository.

See W3C Verifiable Credentials Data Model specification.

Inspired by / incorporates elements of other VC Typescript libraries:

Versioning

The version numbers of this npm module are meant to mirror the version numbers of the Verifiable Credentials Data Model specification. Developers are encouraged to specify which VC Data model version they're using. For example, currently, the VC DM 1.1 is the stable version:

"dependencies": {
   "@digitalcredentials/vc-data-model": "^1.1.0"
}

However, the VC DM 2.0 Working group is currently developing the second version of the specification (which will likely make breaking changes). So, in the future:

"dependencies": {
   "@digitalcredentials/vc-data-model": "^2.0.0"
}

Install

  • Node.js 16+ is recommended.

NPM

To install via NPM:

npm install @digitalcredentials/vc-data-model

Development

To install locally (for development):

git clone https://github.com/digitalcredentials/vc-data-model.git
cd vc-data-model
npm install

Usage

import { VerifiableCredential, VerifiablePresentation } from '@digitalcredentials/vc-data-model'

// for example, in an Express route definition:
const vp = req.body.presentation as VerifiablePresentation

Contribute

PRs accepted.

If editing the Readme, please conform to the standard-readme specification.

License

MIT License © 2022 Digital Credentials Consortium.