How stytchauth/stytch-ios works
High-Level Components
a) Core SDK Layer (StytchCore):
• Components:
• Authentication Clients (Consumer & B2B)
• Networking Layer
• Storage Systems (Keychain, UserDefaults)
• Crypto Operations
• Session Management
b) UI Layer (StytchUI):
• Above Core SDK
• Separate into:
• Consumer UI Components
• B2B UI Components
• Shared UI Elements
c) Integration Layer:
• Top-level showing how apps integrate
• Demo Applications
• Configuration Flow
Component Relationships
a) Data Flow:
App Integration → StytchUI → StytchCore → Backend Services
b) Authentication Flows:
• OAuth
• Magic Links
• OTP
• Passwords
• Biometrics
• SSO (B2B)
Detailed Component Breakdown
For each major component, include:
a) StytchCore:
• Client Management
• Consumer Client
• B2B Client
• Authentication Methods
• OAuth
• Magic Links
• OTP
• Others...
• Networking
• Request Handler
• Response Processing
• Storage
• Keychain
• User Defaults
b) StytchUI:
• View Controllers
• Auth Flows
• User Management
• Components
• Input Fields
• Buttons
• Theme Management
Technical Details
Annotations for:
• Minimum iOS/macOS versions
• Swift Package Manager integration
• Async/await support with alternatives
• Security features
Implementation Notes
Callouts for:
• Configuration requirements
• Error handling flows
• Session management
• Authentication state transitions