Build an App Inside LearnCard
Build, try, and publish an app that runs inside LearnCard and issues credentials to its users.
Users install your app from the LearnCard app store. The Partner Connect SDK gives your app sign-in, credential issuance, permission requests, notifications, and learner context.
The whole flow is Build β Try β Publish. You build against a practice version of LearnCard, then publish from the app itself.
1. Build with practice mode
Install the SDK:
npm install @learncard/partner-connectThen use it like this:
import { createPartnerConnect } from '@learncard/partner-connect';
const learnCard = createPartnerConnect({ hostOrigin: 'https://learncard.app' });
// Sign the learner in
const { user } = await learnCard.requestIdentity();
// Award a credential. LearnCard creates the template the first time you publish.
const credential = await learnCard.sendCredential({
alias: 'course-complete',
template: {
name: 'Completed {{courseName}}',
description: 'Awarded for finishing {{courseName}}.',
achievementType: 'Course',
criteria: { narrative: 'Finished all modules' },
},
templateData: { courseName: 'Intro to Baking' },
});
// Ask permission, saying exactly what you need
const { granted } = await learnCard.requestConsent({
read: { credentialCategories: ['Achievement'], personalFields: ['name'] },
reason: 'Personalize your experience',
});When your app runs on localhost or in the editor preview of Lovable, Bolt, v0, or Replit, the SDK switches to practice mode automatically:
Every call works and shows a short notice of what would happen inside LearnCard.
requestIdentity()returns a practice profile, credentials and counters are kept in the browser, and permission requests are approved.A Practice mode panel in the bottom-left corner lists the LearnCard features your app uses, in plain words.
Start over in that panel (or
learnCard.resetPracticeMode()) clears what was recorded for this app, so it publishes as a new app.
Inside LearnCard, the same code talks to the real host. Practice mode never turns on for a published address such as *.lovable.app or your own domain. See Standalone / Mock Mode for every option.
Working example: the Basic Launchpad app (Astro + vanilla JS) exercises every SDK method.
2. Publish from your app
Click Publish app in the practice panel (or Publish to LearnCard on the card that appears once your app uses LearnCard). The publish page opens in LearnCard:
Sign in or create an account. You come straight back to your app afterwards.
Fill in your store listing. The name and icon are filled in from your app. Add a tagline, description, category, and screenshots β the Store preview shows the listing as learners will see it. Changes save as you go.
Choose where your app will live. If you published from
localhostor a builder preview, enter your public address (for examplehttps://myapp.com). Learners can't open local or preview addresses.Try your app. Switch to Try your app to run it inside LearnCard with a real account. Use Use a test address to try a version still running on your computer or in a builder preview β learners always get your public address. Anything new your app does while you try it is added to the listing.
Set up permission requests if asked. If your app asks for permission without saying what for, the page suggests choices based on what your app does. Tap Enable Consent and the preview reloads so you can check it.
Click Submit for Review.
LearnCard recognizes your app each time you publish, so re-publishing updates the same listing instead of creating a new one. If several apps share one address (for example a few examples on localhost:4321), each keeps its own identity; set mockOptions.appId to pin it. If LearnCard isn't sure which app you mean, it asks.
Age restrictions
You can configure age-based access controls for your app:
age_rating
'4+' | '9+' | '12+' | '17+'
Content rating similar to app store ratings. Indicates the maturity level of content.
min_age
number (0-18)
Minimum age (in years) required to access this app. Users below this age will not see or be able to launch the app.
3. After you submit
Every app has a status page under Your Apps (/app-store/developer), which shows where it is:
Draft
Only you can see it.
Edit, try, submit, or delete it.
In review
Waiting for the LearnCard team.
Withdraw it to make more changes.
Live
In the app store.
Submit updates.
Removed
Not in the store β it wasn't approved, or was taken down.
Delete it, then publish again.
You get a LearnCard notification when your app is approved or needs changes.
Updating a live app. Edits to a live app β including new features your app starts using β are saved as an update and go through review. Learners keep seeing the current version until the update is approved. You can withdraw or discard a pending update at any time.
Who signs app credentials
Credentials your app issues are signed by your app, not your personal account (technically, the app's identifier did:web:network.learncard.com:app:<slug>). In the LearnCard App, they show your app's name and icon.
Know who the user is
Inside LearnCard, the Partner Connect SDK asks the host for the user's identity:
Use user.did as the stable ID. Never trust user.did from the browser without verifying token. The token is a DID-Auth Verifiable Presentation JWT signed by the user's key and bound to your app's origin.
Verify it on your backend:
What else your app can do
The Partner Connect SDK provides several advanced capabilities for apps:
Learner context for AI
Retrieve a user's credentials and profile data to personalize AI
Counters
Track progress, streaks, or thresholds (up to 50 keys per app/user)
For schools and districts
For schools or districts with network filtering, allow outbound traffic to these domains. The SDK's separate hostOrigin setting controls which LearnCard hosts can send messages to your app.
learncard.app
The LearnCard host application
network.learncard.com
LearnCloud Network API
cloud.learncard.com
LearnCloud Storage / xAPI
Self-hosted and staging environments use the domains in their tenant configuration.
Rate limits & good citizenship
In-app notifications: 10/hour per user per app via the SDK; 60/hour per app via the server-to-server route
Counters: up to 50 keys per app per user
Never bypass origin validation, and handle every SDK call's rejection path β users can decline any request
See Errors & Limits for the authoritative rate-limit reference (including the counter write-rate limit).
Full API reference
Partner Connect SDK documents every method, type, error code, and mock-mode option β see also Methods and Errors, Types & Migration.
Last updated
Was this helpful?