Prerequisites
Prerequisites
- Unity 6000.0+ (Unity 6) or newer
- Environment ID from Dynamic Dashboard
- macOS, iOS, or Android for testing (Windows/Linux editors support development only)
Install the SDK
Step 1: Add scoped registry
Open your Unity project and go to Edit > Project Settings > Package Manager. Add a new scoped registry:| Field | Value |
|---|---|
| Name | Dynamic SDK |
| URL | https://packages.dynamic.xyz |
| Scope(s) | xyz.dynamic.unitysdk |
Step 2: Install the SDK
Open Window > Package Manager, click the + button, and select Install package by name. Enter:xyz.dynamic.unitysdk
Leave the version blank to install the latest version.
Step 3: Install UniTask (required dependency)
OpenPackages/manifest.json in a text editor and add to the dependencies section:
Step 4: Install Solana support (optional)
If you need Solana transaction building (not just message signing), install the Solana extension package. In Package Manager > Install package by name, enter:xyz.dynamic.unitysdk.solana
Then add the following to your Packages/manifest.json dependencies:
The Solana extension package only enables transaction building (RPC calls,
PublicKey, SystemProgram.Transfer, etc.). Plain-text message signing via the Dynamic webview works without this package.Android setup
Go to Edit > Project Settings > Player > Android > Publishing Settings and enable:- Custom Main Gradle Template
Assets/Plugins/Android/mainTemplate.gradle. Replace its contents with:
androidx.credentials+credentials-play-services-auth— required for Passkey (WebAuthn) supportandroidx.datastore+tink-android— required for secure storageandroidx.browser— required for OAuth social login flowscom.google.guava— required by Solana SDK
Initialize the SDK
Step 1: Create configuration asset
In the Unity Editor: Assets > Create > DynamicSDK > Client Props This creates aClientPropsData ScriptableObject. Configure it in the Inspector:
| Field | Required | Description |
|---|---|---|
| Environment ID | Yes | Your environment ID from the Dynamic dashboard |
| App Name | No | Your application name |
| App Logo URL | No | URL to your app logo |
| App Origin | Yes | Mandatory for EOA connections and for passkey verification |
| Log Level | No | Error (default), Warning, Info, or Debug |
| Debug Webview | No | Enable WebView debugging |
Step 2: Create initializer script
Create a MonoBehaviour that initializes the SDK onAwake:
ClientPropsData asset to the props field.
The SDK creates a DontDestroyOnLoad GameObject and persists across scene loads.
Step 3: Wait for SDK ready
The SDK loads asynchronously via WebView. You must wait for it to be ready:Basic usage
Using built-in authentication UI
The easiest way to add authentication is using the Dynamic Widget:Listening for authentication state
Enable features in dashboard
Before you can use authentication and wallet features, enable them in your Dynamic dashboard:- Go to your Dynamic Dashboard
- Select your project
- Go to Authentication and enable the methods you want to use:
- Email OTP
- SMS OTP
- Social providers (Google, Apple, Farcaster)
- Passkeys
- Go to Wallets and enable embedded wallets
- Go to Chains and enable the networks you want to support (EVM, Solana, and/or SUI)
Troubleshooting
Common issues
-
SDK not initialized
- Ensure
DynamicSDK.Init(props)is called inAwake()before any other SDK methods - Wait for
OnWebViewReadyevent before calling SDK methods
- Ensure
-
Passkeys not working in Editor
- Passkey authentication only works on native devices (iOS/Android)
- Use Email OTP or Social login for Editor testing on macOS
-
Android build fails
- Verify the Main Gradle Template is configured correctly
- Check that all required dependencies are included
-
WebView not loading
- Check your Environment ID is correct
- Ensure App Origin is set for passkey and EOA connections
- Enable Debug Webview to see console logs
What’s next
- Introduction - Learn about all SDK features and architecture
- Authentication Guide - Implement email, SMS, social, and passkey authentication
- Session Management - Manage authenticated sessions
- Wallet Operations - Work with balances and transactions
- EVM Operations - Send EVM transactions
- Solana Operations - Send Solana transactions
- SUI Operations - Send SUI transactions