ConsentFlow
ConsentFlow contracts allow you to read and write to a LearnCard with the consent of the LearnCard owner
Last updated
Was this helpful?
ConsentFlow contracts allow you to read and write to a LearnCard with the consent of the LearnCard owner
Last updated
Was this helpful?
pnpm dlx @learncard/cli
const networkLearnCard = await initLearnCard({ seed: '[your secure key]', network: true })
Supported values for credential categories are:
Achievement
Accommodation
Accomplishment
Course
ID
Job
Learning History
Membership
Merit Badge
Skill
Social Badge
Work History
If you'd like to set an expiration for your contract you can use the expiresAt
parameter e.g.
If your contract is inteded for minors use the needsGuardianConsent
parameter
If you'd like to specify a url to direct a user to after they've consented to use the redirectUrl
parameter
Upon consenting to the contract users will be redirected to this url with the consenting user's did added as a url parameter
This is the url that users will use to consent to this contract
const url = `https://learncard.app/consent-flow?uri=${contractUri}`
Additionally, you can specify a url to return to after the user has consented to the contract (note: redirect urls must begin with http://
or https://
)
const urlWithRedirect = `https://learncard.app/consent-flow?uri=${contractUri}&returnTo=${redirectUrl}`
let data = await networkLearnCard.invoke.getConsentFlowData(contractUri)
This will return paginated records in the form of:
To retrieve the next page of paginated results use
Use the credential uri to read the user's credential
✨💃🪩🕺✨
If you want your ConsentFlow contract to be displayed in , please contact LearningEconomy (support@learningeconomy.io) with the uri of your contract