Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Latest commit

 

History

History
59 lines (46 loc) · 1.59 KB

README.md

File metadata and controls

59 lines (46 loc) · 1.59 KB

logo

vc-json-schemas-parser

A parser for VC JSON Schemas compliant credentials

npm

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: '[email protected]', prefix: { en: 'Email address' } } }
*/

Supports:

  • Email
  • Phone

Run tests

npm test

Build

npm run build

Contribute