Getting Started with Boosts
Prerequisites
npm install @learncard/initSetup Your LearnCard Instance
import { initLearnCard } from '@learncard/init';
// Initialize LearnCard with a seed for key generation
const learnCard = await initLearnCard({
seed: 'your-secure-seed-value',
network: true
});Creating a Basic Boost Credential
// Define credential issuer and subject
const issuerDID = 'did:web:network.learncard.com:users:issuer-example';
const subjectDID = 'did:web:network.learncard.com:users:example';
// Create a basic Boost Credential
const basicBoostCredential = {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.1.json",
"https://ctx.learncard.com/boosts/1.0.3.json",
],
"credentialSubject": {
"achievement": {
"achievementType": "Badge",
"criteria": {
"narrative": "This badge is awarded for demonstrating teamwork skills."
},
"description": "Recognizes excellence in team collaboration.",
"id": "urn:uuid:" + crypto.randomUUID(), // Generate a unique ID
"image": "https://example.com/badge-images/teamwork.png",
"name": "Team Player",
"type": [
"Achievement"
]
},
"id": subjectDID,
"type": [
"AchievementSubject"
]
},
"display": {
"backgroundColor": "#4285F4",
"displayType": "badge"
},
"image": "https://example.com/badge-images/teamwork.png",
"issuanceDate": new Date().toISOString(),
"issuer": issuerDID,
"name": "Team Player Badge",
"type": [
"VerifiableCredential",
"OpenBadgeCredential",
"BoostCredential"
]
};
// Sign the credential to verify you created it correctly
const signedCredential = await learnCard.invoke.issueCredential(basicBoostCredential);
// Now you have a verifiable Boost Credential that can be shared with the recipient
console.log(JSON.stringify(signedCredential, null, 2));Customizing Display Options
Adding Skills Information
Adding Attachments
Creating a BoostID
Real-world Use Cases
Educational Achievement Badges
Professional Certification
Adding Evidence to Boost Credentials
Understanding Evidence in Open Badge v3
How to Add Evidence to Boost Credentials
Evidence Properties
Best Practices for Evidence
Example: Portfolio Evidence
Example: Multiple Evidence Types
Best Practices
Troubleshooting
Common Issues
Last updated
Was this helpful?