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

A parser for VC JSON Schemas compliant credentials

Notifications You must be signed in to change notification settings

rsksmart/vc-json-schemas-parser

Repository files navigation

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

About

A parser for VC JSON Schemas compliant credentials

Resources

Stars

Watchers

Forks

Packages

No packages published