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
  • What is GameFlow?
  • Setting up GameFlow
  • Overview
  • Creating Your GameFlow Contract
  • Example GameFlow Contract
  • Integrating with xAPI
  • Overview
  • Authentication Process

Was this helpful?

  1. LearnCard SDK

GameFlow

Securely connecting educational games with digital learning achievements

PreviousSetting Up ConsentFlow with an Independent NetworkNextSending xAPI Statements

Last updated 3 months ago

Was this helpful?

What is GameFlow?

GameFlow is an integration framework that creates a seamless connection between educational games and the LearnCard digital wallet system. At its core, GameFlow enables educational games to interact with a student's LearnCard, allowing the secure exchange of learning credentials and achievement data.

Think of GameFlow as a secure bridge between two important pieces: the LearnCard App (which stores a learner's educational accomplishments) and educational games (which create new learning experiences). When a game is connected through GameFlow, it can both read existing achievements from the student's LearnCard wallet and write new credentials as the student progresses through the game.

By implementing GameFlow, game developers can focus on creating engaging educational experiences while knowing that all student achievement data will be securely and appropriately handled within the LearnCard ecosystem.

Setting up GameFlow

Overview

Creating Your GameFlow Contract

Required Configuration

1. Guardian Consent Settings

needsGuardianConsent: true

This crucial setting activates GameFlow's child protection features. When enabled, the system will automatically guide users through a secure process where:

  • An adult must first verify their presence

  • The adult can then select which child is playing

  • Finally, the adult reviews and grants consent for the game's data access

2. Redirect Configuration

redirectUrl: "https://your-game-domain.com/callback"

After consent is granted, GameFlow needs to know where to send the user. The redirect URL must:

  • Begin with either http:// or https://

  • Be prepared to receive the consenting user's DID as a query parameter: did={consentingUsersDid}

  • Lead to an appropriate landing page in your game

3. Access Reason (Recommended)

reasonForAccessing: "Your custom message here"

While optional, providing a clear reason helps parents understand why your game needs access to their child's LearnCard. This message appears on the consent screen and should:

  • Explain the educational value

  • Describe what data will be accessed or stored

  • Use clear, parent-friendly language

If you don't specify a reason, the system will display a default message: "Get an adult to save your progress and skills"

Example GameFlow Contract

const exampleGameFlowContract = {
    name: "GameFlow Docs Contract",
    subtitle: "Example GameFlow contract for The Docs",
    description: "Look here. This is how you GameFlow contract.",
    image:
        "https://media-be.chewy.com/wp-content/uploads/2022/09/27110948/cute-dogs-hero-1024x615.jpg",
    needsGuardianConsent: true,
    redirectUrl: "https://your-website.com",
    reasonForAccessing: "Allow this game to track your achievements!",
    contract: {
        read: {
            anonymize: true,
            credentials: {
                categories: {
                    "Social Badge": { required: false },
                    Achievement: { required: true },
                },
            },
            personal: { Name: { required: false } },
        },
        write: {
            credentials: {
                categories: {
                    ID: { required: true },
                    "Learning History": { required: false },
                },
            },
            personal: { SomeCustomID: { required: true } },
        },
    },
};


const contractUri = await networkLearnCard.invoke.createContract(exampleGameFlowContract);

Integrating with xAPI

Overview

GameFlow seamlessly integrates with xAPI to track learning experiences while maintaining secure authentication through DIDs (Decentralized Identifiers). Let's explore how to implement this integration step by step.

Authentication Process

When a user consents to your application through GameFlow, they provide a special "Delegate Credential" via the LearnCard Network. This credential enables your application to issue xAPI statements on behalf of the user. Here's how the authentication flow works:

  1. The user grants consent to your application

  2. You receive a Verifiable Presentation (VP) containing the Delegate Credential through the query param vp

  3. (Optionally) You create a new DID-Auth VP using this credential

  4. The DID-Auth VP from either Step 2 or Step 3 is included with your xAPI requests as an "X-VP" header

Since many educational games are designed for younger learners, GameFlow includes comprehensive safety features. Central to this is its built-in guardianship consent system, which ensures parents or guardians maintain oversight of how their child's educational data is used. The system leverages technology to provide precise control over data ownership and privacy, giving families peace of mind about their children's digital learning journey.

GameFlow builds upon 's powerful contract system to manage permissions and data access in educational games. Before implementing GameFlow, we recommend familiarizing yourself with ConsentFlow's documentation to understand its contract system and management capabilities.

While GameFlow contracts follow the standard creation process, they require three specific configurations to enable their educational gaming features:

When you're ready, head to the next section to start .

🔰
ConsentFlow
ConsentFlow
ConsentFlow
sending xAPI statements
GameFlow Overview