LearnCard Developer Docs
  • 🚀Get Started
    • 👋Welcome
    • ⭐Who are you?
      • Learners & Employees
      • Traditional Educator
      • Non-Traditional Educator
      • Assessment Provider
      • Employer
      • App Developer & EdTech
      • DAO & Communities
      • Content Creators
      • Research Institutions
      • NGOs & Governments
      • Plugfest Partner
        • Guide for Interop Issuers
          • 🤽Creating an Interop Issuer
        • Guide for Interop Wallets
    • Protocol Overview
      • The Internet of Education
      • The Learning Economy
      • Learner & Employee Privacy
      • 22nd Century Education
      • The Open Credential Network
      • PVCs
  • 🔰LearnCard SDK
    • What is LearnCard?
      • Why a Universal Wallet?
      • Architectural Patterns
      • Production Deployment Guide
      • Troubleshooting Guide
    • LearnCard Core
      • Quick Start
        • Create New Credentials
          • Creating Verifiable Credentials for LearnCard
          • Achievement Types and Categories
          • Custom Types
          • Understanding Boosts
          • Creating Boost Credentials
        • Sign & Send Credentials
        • Accept & Verify Credentials
        • Share & Present Credentials
      • Construction
        • Managing Seed Phrases
        • initLearnCard
        • DIDKit
        • learnCardFromSeed
        • emptyLearnCard
        • IDX Config
      • Control Planes
        • ID
        • Read
        • Store
        • Index
        • Cache
        • Context
      • Plugins
        • Adding Plugins
        • Official Plugins
          • Dynamic Loader
          • Crypto
          • DIDKit
          • DID Key
          • VC
            • Expiration Sub-Plugin
          • VC Resolution
          • VC-Templates
          • VC-API
          • Ceramic
          • IDX
          • VPQR
          • Ethereum
          • CHAPI
          • LearnCard Network
          • LearnCloud
          • LearnCard
          • Claimable Boosts
        • Writing Plugins
          • The Simplest Plugin
          • The Plugin Type
          • The LearnCard Type
          • Implementing Control Planes
          • Implementing Methods
          • The Implicit LearnCard
          • Depending on Plugins
          • Private Fields
          • Publishing a Plugin to NPM
      • URIs
      • CHAPI
        • ⭐CHAPI Wallet Setup Guide
        • ↔️Translating to CHAPI documentation
        • 🖥️Demo Application
        • 🔰Using LearnCard to Interact with a CHAPI Wallet
        • 📝Cheat Sheets
          • Issuers
          • Wallets
      • LearnCard UX
        • Quick Start
        • Components
          • Verifiable Credentials
            • VC Thumbnail
            • VC Thumbnail, Mini
          • LearnCards
            • LearnCard Front
            • LearnCard Back
        • API
      • LearnCard Bridge
      • API
      • Migration Guide
    • LearnCard Network
      • LearnCard Network API
        • Authentication
        • Auth Grants and API Tokens
        • Profile
        • Credentials
        • Boosts
        • Presentations
        • Storage
        • Signing Authorities
        • Notifications
        • API Docs
        • Launch Your Own Network
      • 🔌Connect Your Application
    • ConsentFlow
      • Setting Up ConsentFlow with an Independent Network
    • GameFlow
      • Sending xAPI Statements
        • xAPI URIs
      • Reading xAPI Statements
        • Advanced xAPI Statement Queries
      • Consentful "Claim Later" Flow
  • 🚀Applications
    • LearnCard
    • SuperSkills!
      • SuperSkills! SDK
        • Digital Wallets
        • Issuing into SuperSkills!
        • 🦸Creating a SuperSkills! Issuer
    • Metaversity
    • Admin Dashboard
  • 🔗Resources
    • Github
    • Community
    • 💅Custom Development
    • Contact Our Team
    • Learning Economy
  • 🤖LearnCard Services
    • LearnCard CLI
    • Discord Bot
    • Metamask Snap
  • 💸LearnBank SDK
    • Why LearnBank?
  • 📊LearnGraph SDK
    • Why LearnGraph?
Powered by GitBook
On this page
  • Install
  • Basic Credential
  • Achievement Credential:
  • Other Types

Was this helpful?

  1. LearnCard SDK
  2. LearnCard Core
  3. Plugins
  4. Official Plugins

VC-Templates

Plugin for creating new credentials from basic templates

PreviousVC ResolutionNextVC-API

Last updated 1 month ago

Was this helpful?

This is a plugin for simplifying useful, meaningful credentials with minimal input. Additionally, this plugin can be used as reference for to add simple templates for creating new credentials.

Install

pnpm i @learncard/vc-templates-plugin

Basic Credential

The credential of type basic is the most simple credential, following the minimum information required by the Verifiable Credential specification.

LearnCard CLI
// Basic Credential: with default, 'basic' template
learnCard.invoke.newCredential();
learnCard.invoke.newCredential({ type: 'basic' });
/**
{
  '@context': [ 'https://www.w3.org/2018/credentials/v1' ],
  id: 'http://example.org/credentials/3731',
  type: [ 'VerifiableCredential' ],
  issuer: 'did:key:z6MkmF9iYcGTRiHFavPPYurDNuDfYMJQR66oGrSGnfnNpPzc',
  issuanceDate: '2020-08-19T21:41:50Z',
  credentialSubject: { id: 'did:example:d23dd687a7dc6787646f2eb98d0' }
}
**/

// Basic Credential: with did, subject, and issuanceDate overloads
learnCard.invoke.newCredential({ 
  type: 'basic', 
  did:'did:example:123', 
  subject: 'did:example:456', 
  issuanceDate: '2020-08-19T21:41:50Z' 
});
/**
{
  '@context': [ 'https://www.w3.org/2018/credentials/v1' ],
  id: 'http://example.org/credentials/3731',
  type: [ 'VerifiableCredential' ],
  issuer: 'did:example:123',
  issuanceDate: '2020-08-19T21:41:50Z',
  credentialSubject: { id: 'did:example:456' }
}
**/

Achievement Credential:

LearnCard CLI
// Achievement Credential: with default, 'achievement' template
learnCard.invoke.newCredential({ type: 'achievement' });
/**
{
  '@context': [
    'https://www.w3.org/2018/credentials/v1',
    'https://imsglobal.github.io/openbadges-specification/context.json'
  ],
  id: 'http://example.com/credentials/3527',
  type: [ 'VerifiableCredential', 'OpenBadgeCredential' ],
  issuer: 'did:key:z6MkmF9iYcGTRiHFavPPYurDNuDfYMJQR66oGrSGnfnNpPzc',
  issuanceDate: '2020-08-19T21:41:50Z',
  name: 'Teamwork Badge',
  credentialSubject: {
    id: 'did:example:d23dd687a7dc6787646f2eb98d0',
    type: [ 'AchievementSubject' ],
    achievement: {
      id: 'https://example.com/achievements/21st-century-skills/teamwork',
      type: [Array],
      criteria: [Object],
      description: 'This badge recognizes the development of the capacity to collaborate within a group environment.',
      name: 'Teamwork'
    }
  }
}
**/

// Achievement Credential: with overloads
learnCard.invoke.newCredential({ 
  type: 'achievement', 
  did:'did:example:123', 
  subject: 'did:example:456', 
  name: 'Singing Badge',
  achievementName: 'Beautiful Singing',
  description: 'This badge recognizes beautiful singing.',
  criteriaNarrative: 'Group members earn this badge when they sing a beautiful song at Karaoke night.',
  issuanceDate: '2020-08-19T21:41:50Z' 
});
/**
{
  '@context': [
    'https://www.w3.org/2018/credentials/v1',
    'https://imsglobal.github.io/openbadges-specification/context.json'
  ],
  id: 'http://example.com/credentials/3527',
  type: [ 'VerifiableCredential', 'OpenBadgeCredential' ],
  issuer: 'did:example:123',
  issuanceDate: '2020-08-19T21:41:50Z',
  name: 'Singing Badge',
  credentialSubject: {
    id: 'did:example:456',
    type: [ 'AchievementSubject' ],
    achievement: {
      id: 'https://example.com/achievements/21st-century-skills/teamwork',
      type: [Array],
      criteria: [Object],
      description: 'This badge recognizes beautiful singing.',
      name: 'Beautiful Singing'
    }
  }
}
**/

Other Types

More credential types are coming soon! Have a particular credential type you'd like to turn into a template? Start a conversation in our :

💡

💖

🔰
creating your own plugin
Github Discussions
Post a Credential Template Request
Ask for Help