Claim Data after Guardian Consent
How to implement the Consentful "Claim Later" Flow
Overview
The Consentful "Claim Later" Flow enables applications to save an ephemeral user's session data as a "Save Game" state, which can be restored after obtaining guardian consent. This pattern is ideal for applications that need to:
Create low-PII profiles quickly (using nicknames)
Allow users to start using the application immediately
Obtain guardian consent after initial engagement
Restore the user's session state after consent is granted
Use Case: MyLittleTabbyCat
To illustrate this flow, we'll use a fictional application called "MyLittleTabbyCat" where a child creates a personalized tabby cat and receives daily inspirational quotes. The child initially creates their cat in an ephemeral session, then takes a QR code home for their guardian to scan and provide consent.
Implementation Steps
Before you begin, make sure you've setup a Service Profile in the network for your LearnCard.
const serviceProfile = {
displayName: 'My Tabby Cat',
profileId: 'my-tabby-cat',
image: 'https://i.postimg.cc/s2xdx5Ss/erik-jan-leusink-Ib-Px-GLg-Ji-MI-unsplash.jpg',
};
await learnCard.invoke.createServiceProfile(serviceProfile);1. Create a "Save Game" Boost
After the user creates their content in your application, store this data as a Boost on the LearnCard network:
2. Create a Guardian ConsentFlow
After creating the boost, set up a ConsentFlow that requires guardian consent:
To attach autoboosts to your ConsentFlow, you need to setup a "Signing Authority". You can do this once for your LearnCard service profile like so:
3. Generate QR Code for User
Display a QR code linking to the ConsentFlow for the user:
4. Handle Redirect After Guardian Consent
After the guardian provides consent, LearnCard redirects to your application's callback URL with the user's DID:
5. Retrieve "Save Game" Data
After receiving the user's DID, retrieve their boost data to restore their session:
6. Return User Flow (Login by Cat Name)
For returning users who know their cat's name:
Complete Flow Diagram
User creates content in your application (ephemeral session)
Application creates a Boost with the user's data
Application creates a ConsentFlow with guardian consent requirement, linking the Boost
User receives a QR code to take home
Guardian scans QR code and provides consent
User is redirected back to your application with their LearnCard DID
Application retrieves "Save Game" data using the DID
Application restores the user's session
Best Practices
Add Searchable Metadata: Always include unique identifiers in the boost metadata for easy lookup.
Clear Consent Reasons: Provide clear explanations for guardians about what data is being stored.
Graceful Fallbacks: Handle cases where consent is denied or the process is interrupted.
Secure User Associations: Verify that the returning user is associated with the correct boost.
Data Minimization: Store only necessary information in the boost credential.
Related Documentation
For more information on GameFlow (the framework this flow is built on), see the GameFlow documentation.
Last updated
Was this helpful?