DynamicSDK.initialize
Initialize the Dynamic SDK. This must be called once at app launch, before any SwiftUI views access the SDK.Parameters
- props (ClientProps) - Configuration object with environment settings
Returns
- DynamicSDK - Initialized SDK instance
Example
DynamicSDK.instance
Get the SDK singleton instance. Only call afterinitialize() has been called.
Returns
- DynamicSDK - The SDK singleton instance
Example
ClientProps
Configuration object for initializing the Dynamic SDK.Properties
| Property | Type | Required | Description |
|---|---|---|---|
environmentId | String | Yes | Your Dynamic environment ID from the dashboard |
appLogoUrl | String | Yes | URL to your app’s logo (shown in auth UI) |
appName | String | Yes | Your app’s display name |
redirectUrl | String | Yes | Deep link URL scheme for callbacks (e.g., yourapp://) |
appOrigin | String | Yes | Your app’s origin URL |
logLevel | LogLevel? | No | Logging level (.debug, .info, .warn, .error) |
debug | ClientDebugProps? | No | Debug options |
Example
ClientDebugProps
Debug configuration options.Properties
- webview (Bool) - Enable WebView debugging
Example
SDK Modules
After initialization, the SDK provides access to various modules:Environment Setup
URL Scheme Configuration
Add a URL scheme to yourInfo.plist for authentication callbacks:
Dashboard Configuration
- Set your
redirectUrlto match your URL scheme (e.g.,yourapp://) - Whitelist your deep link URL in Dynamic dashboard under Security → Whitelist Mobile Deeplink