Integration Strategies
Common architectural patterns for LearnCard SDK integration
This guide describes common architectural patterns for integrating LearnCard SDK into your applications, with real-world examples and implementation recommendations.
Choosing the Right Architecture
LearnCard can be integrated into various architectures depending on your specific requirements:
Browser-based client-side
Personal wallets, user-controlled credentials
Private key security, WASM loading
Server-side API
Credential issuer services, verification services
Key management, scaling
Mobile apps
Personal wallets with native integration
Storage, secure enclave
Serverless functions
Verification workflows, on-demand issuance
Cold starts, timeouts
Hybrid
Enterprise solutions with mixed requirements
Complexity, security boundaries
Pattern 1: Browser-Based Personal Wallet
This pattern uses LearnCard directly in the browser, with user-controlled keys.
Components
Frontend Application: Typically a React/Vue/Angular SPA
Browser Storage: For secure storage of encrypted keys
LearnCard Core: Running directly in the browser
External Storage Services: Optional LearnCloud or Ceramic integration
Implementation Example
Security Considerations
Key Derivation: Never store raw keys in localStorage or sessionStorage
Recovery Mechanisms: Implement key recovery flows (e.g., social recovery)
Encryption: Use additional encryption for sensitive data
Pattern 2: Server-Side Issuer Service
This pattern uses LearnCard on a server to issue credentials to users.
Components
API Server: Node.js/Express/FastAPI service
Secure Key Storage: Hardware Security Module (HSM) or KMS
LearnCard Core: Running on the server
Database: For tracking issued credentials
Implementation Example
Security Considerations
Access Control: Implement proper authentication and authorization for the API
Rate Limiting: Prevent abuse with rate limiting
Audit Logging: Keep detailed logs of all issuance operations
Pattern 3: Mobile Wallet Integration
This pattern integrates LearnCard into mobile applications.
Components
Mobile App: Native or React Native application
Secure Storage: Keychain/Keystore for secure key storage
LearnCard Core: Running in the mobile environment
Local DB: For caching and offline functionality
Implementation Example (React Native)
Security Considerations
Biometric Protection: Use biometric authentication for key access
Secure Enclave: Utilize secure hardware when available
Offline Support: Implement proper caching for offline usage
Pattern 4: Verification Service
This pattern implements a dedicated service for verifying credentials.
Components
API Server: Lightweight verification endpoint
LearnCard Core: Configured with verification plugins
Caching Layer: For improved performance
Monitoring: For tracking verification metrics
Implementation Example
Performance Considerations
Caching: Cache verification results for frequently verified credentials
DID Resolution Caching: Cache DID documents to reduce resolution time
Horizontal Scaling: Deploy multiple instances for high-volume scenarios
Pattern 5: Hybrid Credential Exchange
This pattern combines elements of client and server approaches for enterprise scenarios.
Components
Client Wallet: Browser or mobile wallet for user
Issuer Service: Server-side credential issuance
Exchange Protocol: CHAPI, QR, or direct API
Verification Service: Independent verification capability
Implementation Example (CHAPI Exchange)
Architectural Considerations
Authentication Flows: Ensure proper user authentication on both sides
Protocol Standards: Adhere to standard protocols (CHAPI, DIDComm)
Privacy: Minimize data sharing between services
Pattern 6: Enterprise Integration Hub
This pattern creates a central hub for enterprise credential issuance and verification.
Components
Admin Dashboard: Management interface for enterprise users
Key Manager: Secure storage for multiple issuer keys
Credential Service: API for credential operations
Integration Adapters: Connectors to enterprise systems
Implementation Example
Enterprise Considerations
Compliance: Ensure the system meets regulatory requirements
Audit Trails: Implement comprehensive logging for all operations
Role-Based Access: Restrict operations based on user roles
Backup and Recovery: Implement secure backup procedures for keys
Conclusion
These architectural patterns provide a foundation for integrating LearnCard SDK into various application scenarios. When designing your architecture, consider:
Security requirements - especially around key management
Performance needs - for high-volume credential operations
User experience - particularly for wallet interfaces
Integration points - with existing systems and services
Each pattern can be adapted and combined to suit your specific requirements. The flexibility of LearnCard's plugin architecture allows for customization while maintaining standard credential workflows.
Last updated
Was this helpful?