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:

Architecture
Best For
Considerations

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

  1. Frontend Application: Typically a React/Vue/Angular SPA

  2. Browser Storage: For secure storage of encrypted keys

  3. LearnCard Core: Running directly in the browser

  4. External Storage Services: Optional LearnCloud or Ceramic integration

Implementation Example

Security Considerations

  1. Key Derivation: Never store raw keys in localStorage or sessionStorage

  2. Recovery Mechanisms: Implement key recovery flows (e.g., social recovery)

  3. 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

  1. API Server: Node.js/Express/FastAPI service

  2. Secure Key Storage: Hardware Security Module (HSM) or KMS

  3. LearnCard Core: Running on the server

  4. Database: For tracking issued credentials

Implementation Example

Security Considerations

  1. Access Control: Implement proper authentication and authorization for the API

  2. Rate Limiting: Prevent abuse with rate limiting

  3. Audit Logging: Keep detailed logs of all issuance operations

Pattern 3: Mobile Wallet Integration

This pattern integrates LearnCard into mobile applications.

Components

  1. Mobile App: Native or React Native application

  2. Secure Storage: Keychain/Keystore for secure key storage

  3. LearnCard Core: Running in the mobile environment

  4. Local DB: For caching and offline functionality

Implementation Example (React Native)

Security Considerations

  1. Biometric Protection: Use biometric authentication for key access

  2. Secure Enclave: Utilize secure hardware when available

  3. Offline Support: Implement proper caching for offline usage

Pattern 4: Verification Service

This pattern implements a dedicated service for verifying credentials.

Components

  1. API Server: Lightweight verification endpoint

  2. LearnCard Core: Configured with verification plugins

  3. Caching Layer: For improved performance

  4. Monitoring: For tracking verification metrics

Implementation Example

Performance Considerations

  1. Caching: Cache verification results for frequently verified credentials

  2. DID Resolution Caching: Cache DID documents to reduce resolution time

  3. 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

  1. Client Wallet: Browser or mobile wallet for user

  2. Issuer Service: Server-side credential issuance

  3. Exchange Protocol: CHAPI, QR, or direct API

  4. Verification Service: Independent verification capability

Implementation Example (CHAPI Exchange)

Architectural Considerations

  1. Authentication Flows: Ensure proper user authentication on both sides

  2. Protocol Standards: Adhere to standard protocols (CHAPI, DIDComm)

  3. Privacy: Minimize data sharing between services

Pattern 6: Enterprise Integration Hub

This pattern creates a central hub for enterprise credential issuance and verification.

Components

  1. Admin Dashboard: Management interface for enterprise users

  2. Key Manager: Secure storage for multiple issuer keys

  3. Credential Service: API for credential operations

  4. Integration Adapters: Connectors to enterprise systems

Implementation Example

Enterprise Considerations

  1. Compliance: Ensure the system meets regulatory requirements

  2. Audit Trails: Implement comprehensive logging for all operations

  3. Role-Based Access: Restrict operations based on user roles

  4. 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:

  1. Security requirements - especially around key management

  2. Performance needs - for high-volume credential operations

  3. User experience - particularly for wallet interfaces

  4. 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?