Connect an Embedded App

How-To Guide: Issue Credentials from Embedded Apps in the LearnCard App Store

Build apps that run inside LearnCard and issue credentials directly to users. This guide covers the App Store integration for embedded applications that want to award badges, certificates, or other verifiable credentials.

Overview

The LearnCard App Store allows third-party applications to be embedded within the LearnCard app. These embedded apps can:

  • Authenticate users via Single Sign-On (SSO)

  • Issue credentials directly to the user's wallet

  • Request credentials for verification or gating

  • Request consent for data sharing agreements and terms acceptance

This is ideal for:

  • Learning platforms awarding course completion badges

  • Games issuing achievement credentials

  • Assessment tools providing certification

  • Any app that wants to reward users with verifiable credentials

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   LearnCard App                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚              Your Embedded App                 β”‚  β”‚
β”‚  β”‚                                               β”‚  β”‚
β”‚  β”‚   1. User completes action                    β”‚  β”‚
β”‚  β”‚   2. App calls sendCredential(templateAlias)  β”‚  β”‚
β”‚  β”‚   3. LearnCard issues from your template      β”‚  β”‚
β”‚  β”‚   4. User sees claim modal                    β”‚  β”‚
β”‚  β”‚   5. Credential stored in wallet              β”‚  β”‚
β”‚  β”‚                                               β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Prerequisites

  1. App Store Listing - Your app must be registered in the LearnCard App Store

  2. Boost Templates - Pre-configured credential templates attached to your listing

  3. Partner Connect SDK - For communication with the LearnCard host

Quick Start

Step 1: Install the SDK

Step 2: Initialize and Send a Credential

That's it! The user will see a claim modal and can accept the credential into their wallet.

Setting Up Your App Store Listing

1. Create Your App Listing

In the LearnCard Developer Portal, create a new app listing with:

  • Name & Description - What your app does

  • Launch URL - Where your embedded app is hosted

  • Permissions - Request credentials:write to issue credentials

2. Create Credential Templates

Templates define what credentials your app can issue. For each type of credential:

  1. Go to your app listing's Templates tab

  2. Click Add Template

  3. Design your credential (name, description, image, achievement type)

  4. Note the Template Alias (auto-generated from name, e.g., course-completion)

The Template Alias is what you'll reference when issuing credentials from your app.

3. Configure Signing Authority

When you add a template to your listing, LearnCard automatically configures a signing authority. This allows credentials to be issued on behalf of your app with proper cryptographic signatures.

API Reference

sendCredential({ templateAlias, templateData? })

Issue a credential to the current user.

Parameters:

Parameter
Type
Required
Description

templateAlias

string

Yes

The template alias configured in your app listing

templateData

object

No

Values for template variables (e.g., {{name}})

Returns: Promise<SendCredentialResponse>

Example with Template Data:

Error Handling

initiateTemplateIssue(templateUri)

Let users send peer-to-peer badges to each other. Unlike sendCredential (which issues from your app to the current user), this opens a flow where the user selects a recipient from their contacts.

Parameters:

Parameter
Type
Required
Description

templateUri

string

Yes

The URI of the badge template to send

Returns: Promise<void>

Example:

How it works:

  1. Your app calls initiateTemplateIssue with a template URI

  2. LearnCard opens a recipient picker for the user

  3. User selects someone from their contacts

  4. Badge is sent from the user to the recipient

Setting up peer badge templates:

  1. Go to your app listing's Templates tab

  2. Create a template and select Peer Badge as the type

  3. Copy the Template URI shown after creation

  4. Use this URI when calling initiateTemplateIssue

circle-info

Peer badges are sent from the user to another person, not from your app. This is ideal for recognition, gratitude, or social features within your app.

requestConsent(contractUri, options?)

Request user consent for a ConsentFlow contract. This is useful when your app needs explicit user permission for data sharing, terms acceptance, or other consent-based flows.

Parameters:

Parameter
Type
Required
Description

contractUri

string

Yes

The URI of the ConsentFlow contract

options

RequestConsentOptions

No

Additional options for the consent flow

Options:

Option
Type
Default
Description

redirect

boolean

false

If true, redirects to the contract's configured URL after consent granted

Returns: Promise<ConsentResponse>

Basic Example:

With Redirect:

How Redirect Works:

When redirect: true is set and the user grants consent:

  1. LearnCard generates a Verifiable Presentation (VP) proving consent

  2. User is redirected to the contract's redirectUrl

  3. The VP and user's DID are appended as URL parameters

  4. Your server can verify the VP to confirm consent

The redirect URL will include:

  • did - The user's DID

  • vp - A signed Verifiable Presentation (JWT format)

Use Cases:

  • Terms of Service - Require users to accept terms before accessing features

  • Data Sharing Agreements - Get explicit consent before sharing data with third parties

  • Privacy Policies - Track user acknowledgment of privacy policies

  • OAuth-like Flows - Use redirect mode for server-side consent verification

circle-info

If the user has already consented to a contract, calling requestConsent will return { granted: true } immediately without showing the consent modal again.

User Experience Flow

When your app issues a credential:

  1. Credential Created - LearnCard issues the credential using your boost template

  2. Claim Modal Appears - User sees a preview of the credential

  3. User Accepts - Credential is stored in their wallet

  4. Notification Updated - If user dismisses, they can claim later from notifications

Complete Example

Here's a full example of a simple embedded app:

Best Practices

1. Design Meaningful Credentials

  • Use clear, descriptive names

  • Include relevant achievement details

  • Add appealing images/icons

  • Set appropriate achievement types (Badge, Certificate, etc.)

2. Issue at the Right Moment

  • Award credentials immediately after achievement

  • Don't spam users with too many credentials

  • Consider combining small achievements into milestone badges

3. Handle Errors Gracefully

  • Always wrap credential issuance in try/catch

  • Provide feedback to users on success/failure

  • Log errors for debugging

4. Test Thoroughly

  • Use the App Preview feature in the Developer Portal

  • Test with different user states (logged in, logged out)

  • Verify credentials appear correctly in the wallet

Testing Your Integration

Using the Developer Portal Preview

  1. Go to your app listing in the Developer Portal

  2. Click Preview App

  3. Your app loads in a test iframe

  4. Test credential issuance - credentials go to your wallet

Local Development

For local development, use the Developer Portal's Preview App feature which provides a test iframe environment. Your app will be loaded within LearnCard and credentials will be issued to your test wallet.

Last updated

Was this helpful?