Skip to main content

Key Features

Authentication

Users can sign in using familiar methods like email OTP, SMS OTP, social providers (Google, Apple, Farcaster), passkeys, or external JWT. The SDK handles all the complexity of OTP generation, verification, and session management.

Multi-Chain Embedded Wallets

Create non-custodial wallets for your users instantly. The SDK supports both EVM chains (Ethereum, Polygon, Base, etc.) and Solana, with wallets secured by advanced MPC technology.

Blockchain Integration

Full EVM and Solana integration with support for custom networks, gas management, transaction handling, and smart contract interactions. Users can send tokens, sign messages, and interact with contracts.

Enterprise Security

Built with security-first principles, including MFA/TOTP support, passkey management, recovery codes, and advanced key management through MPC technology.

SwiftUI & Combine Integration

Native SwiftUI support with Combine framework integration for reactive state management. The SDK provides publishers for authentication state, wallet updates, and more.

Architecture Overview

The Dynamic Swift SDK is built with modern Swift practices:
  • Singleton Pattern - Access SDK through DynamicSDK.instance() after initialization
  • Combine Framework - Reactive publishers for state changes (authenticatedUserChanges, userWalletsChanges)
  • Type Safety - Full Swift type safety with comprehensive error handling
  • Async/Await - Modern Swift concurrency for smooth user experiences
  • Built-in UI - Pre-built authentication and profile UI components

Quick Start

Here’s a quick example of what you can build:
import DynamicSDKSwift
import SwiftUI

// Initialize the SDK at app launch
@main
struct YourApp: App {
    init() {
        _ = DynamicSDK.initialize(
            props: ClientProps(
                environmentId: "YOUR_ENVIRONMENT_ID",
                appLogoUrl: "https://yourdomain.com/logo.png",
                appName: "Your App Name",
                redirectUrl: "yourapp://",
                appOrigin: "https://yourdomain.com"
            )
        )
    }

    var body: some Scene {
        WindowGroup { ContentView() }
    }
}

// Access the SDK singleton
let sdk = DynamicSDK.instance()

// Use built-in authentication UI
sdk.ui.showAuth()

// Or authenticate programmatically with email OTP
try await sdk.auth.email.sendOTP(email: "user@example.com")
try await sdk.auth.email.verifyOTP(token: "123456")

// Social authentication
try await sdk.auth.social.connect(provider: .google) // or .apple, .farcaster

// Access authenticated user
if let user = sdk.auth.authenticatedUser {
    print("Welcome \(user.email ?? "")")
}

// Get user wallets (automatically created after authentication)
let wallets = sdk.wallets.userWallets

// Get wallet balance
if let wallet = wallets.first {
    let balance = try await sdk.wallets.getBalance(wallet: wallet)
    print("Balance: \(balance)")
}

// Sign a message
let signature = try await sdk.wallets.signMessage(wallet: wallet, message: "Hello!")

// Send EVM transaction
let transaction = EthereumTransaction(
    to: recipientAddress,
    value: amountInWei,
    gasLimit: 21000,
    maxFeePerGas: gasPrice,
    maxPriorityFeePerGas: gasPrice
)
let txHash = try await sdk.evm.sendTransaction(transaction: transaction, wallet: wallet)
print("Transaction sent: \(txHash)")

// Logout
try await sdk.auth.logout()

Prerequisites

Getting Started

Wallet & Blockchain

Advanced Features

Complete Example App: Check out our Swift SDK Repository for a fully functional iOS app demonstrating all SDK features including authentication flows, wallet management, EVM/Solana transactions, MFA, and passkeys.