Example Verifiable Credentials. Beyond being useful for general testing, these are also in use on the Verifiable Credential Playground.
[!WARNING] The Verifiable Credentials in this repository are primarily created for the Verifiable Credentials Playground. Consequently, they should not be considered production ready credentials and they may be missing many necessary production and stability focused features. Please only use them for experimentation.
Credentials added to this package are used on the VC Playground's Issuer tool.
To install locally (for development):
git clone https://github.com/credential-handler/vc-examples.git
cd vc-examples
npm install
To run test:
npm test
To check credentials against local (and remote) contexts:
npm run check
This uses jsonld.js's "Safe Mode" to to check for missing terms.
All local example context files are added as static contexts mapped to their future publication URLs via jsonld-document-loader.
To add or update credentials in the ./credentials
directory:
./credentials
directory, create a new directory for the
credential. Make sure to use kebab case for the directory name.credential.json
file.
This file should contain all the necessary information for the credential,
including the issuer, credential subject, and other relevant data, for example
./credentials/movie-ticket/credential.json
. The credential MUST be conformant
to VC Data Model 1.1.image
file for the credential in the
corresponding directory. The image file should be in either JPG
or PNG
format, for example ./credentials/movie-ticket/image.png
.To optionally add or update contexts in the ./contexts
directory:
./contexts
directory. Make sure to use kebab case for
the directory name. It should contain a file v1.json
that should contain the
JSON-LD context definition for the credential, for example
./contexts/movie-ticket/v1.json
. The context MUST be conformant
to VC Data Model 1.1.v2.json
containing the updated JSON-LD context definition within
./contexts/alumni
. The previous version,v1.json
, should be retained in the
directory without any modifications../contexts
directory follow the format:
https://contexts.vcplayground.org/examples/foo-bar/v1.json
.vocab
directory within your ./contexts/foo-bar
context directory. Inside the
./contexts/foo-bar/vocab
directory, you can define the vocabularies within an
index.html
file.import {credentialsDir} from '@credential-handler/vc-examples';
import {contextsDir} from '@credential-handler/vc-examples';
Use the extract-contexts.js
script to generate an array of context URLs used
in by these examples.
$ node extract-contexts.js
See the contribute file!
PRs accepted.
If editing the Readme, please conform to the standard-readme specification.
New BSD License (3-clause) © Digital Bazaar