npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@credential-handler/vc-examples

v6.13.0

Published

Verifiable Credentials for the CHAPI Issuer Playground

Downloads

514

Readme

Example Verifiable Credentials (@credential-handler/vc-examples)

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.

Table of Contents

Background

Credentials added to this package are used on the VC Playground's Issuer tool.

Install

  • Node.js 18+ is required.

Development

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.

Usage

Add / Update a Verifiable Credential

To add or update credentials in the ./credentials directory:

  1. Within the ./credentials directory, create a new directory for the credential. Make sure to use kebab case for the directory name.
  2. Inside the newly created credential directory, add a 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.
  3. Additionally, place a logo 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.

Add / Update a Credential Context

To optionally add or update contexts in the ./contexts directory:

  1. If you wish to include a context for a credential, create a new directory for the context in the ./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.
  2. Please note that once a context is created, it becomes locked and cannot be modified. If you want to update or make changes to a context, you must create a new context file with a new version within the context directory. For instance, if you want to update the context for the "Alumni" credential, create a new file named 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.
  3. Please make sure that the context URLs for the contexts created in the ./contexts directory follow the format: https://contexts.vcplayground.org/examples/foo-bar/v1.json.
  4. In case you need to add a custom vocabulary documentation, you can include a 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.

Get the path to credentials directory

import {credentialsDir} from '@credential-handler/vc-examples';

Get the path to contexts directory

import {contextsDir} from '@credential-handler/vc-examples';

Contribute

See the contribute file!

PRs accepted.

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

License

New BSD License (3-clause) © Digital Bazaar