1.0.0 • Published 3 years ago

jesse-vc-json-schemas-parser v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
3 years ago
npm i did-jwt @rsksmart/vc-json-schemas-parser

This library can be used to parse credentials that are compatible with Verifiable Credentials JSON Schemas

Quick start

To parse a credential that complies with a given schema

import { decodeJWT } from 'did-jwt'
import { parseVerifiableCredential } from '@rsksmart/vc-json-schemas-parser'

const emailVC = '...'
const decodedEmailVC = decodeJWT(emailVC)
const parsedEmailVC = parseVerifiableCredential('Email', decodedEmailVC.payload)
/*
{ Email:
       { text: 'ilan@iovlabs.org', prefix: { en: 'Email address' } } }
*/

Run tests

npm test

Build

npm run build

Contribute