Unity SDK
Unity SDK v5 → v6 Migration Guide
Unity SDK v6 modernises wallet flows, trims unused integrations, and keeps the .NET interoperability you relied on in v5. This document compares the two ThirdwebManagerBase implementations and lists the code edits required to upgrade an existing project.
- Wallet providers – The
WalletProviderenum now only exposesInAppWallet,EcosystemWallet, andReownWallet.PrivateKeyWallet,WalletConnectWallet, andMetaMaskWallethandlers were removed from the manager. - Reown integration – External wallets are unified under the optional
ReownWalletprovider. Support is wrapped in#if THIRDWEB_REOWNguards and requires Reown AppKit in your project. - Option models –
EcosystemWalletOptionsandInAppWalletOptionsno longer acceptlegacyEncryptionKey.WalletOptionsgained aReownOptionspayload that is filled with sensible defaults when omitted. - Manager internals –
SupportedChains,IncludedWalletIds, and the_walletMappingaccessors were deleted.ConnectWalletnow setsActiveWalletdirectly and only persists the most recent wallet for auto-connect. - Version + diagnostics –
THIRDWEB_UNITY_SDK_VERSIONjumped to6.0.0, and the boot sequence logs an explicit error ifTHIRDWEB_REOWNis defined but the AppKit prefab is missing from the scene.
Create a migration branch
Before updating, branch or clone your project. The v6 package deletes v5 scripts and prefabs; keeping a clean comparison helps when you reapply custom UI.
- Delete the v5 Thirdweb folder.
- Import the v6 Unity package.
- Remove any outdated assembly definition references.
Unity cache tip
After deleting old assemblies, run a domain reload (enter/exit Play mode) so Unity forgets the stale DLLs before you open scenes.
2. Replace ThirdwebManager prefabs or components
The serialized shape of ThirdwebManagerBase changed between branches. Drop the new prefab into your scenes (or update custom subclasses) and clear orphaned fields.
Key property changes in the component:
Reown replaces both MetaMask and WalletConnect. The v6 manager checks for the AppKit prefab whenever the THIRDWEB_REOWN scripting define symbol is set.
To enable Reown:
- Install the Reown AppKit Unity package.
- Add
THIRDWEB_REOWNto Player Settings → Other Settings → Scripting Define Symbols for every build target that uses external wallets. - Drop the
Reown AppKitprefab into the scenes that should surface the modal.
If you’re shipping only in-app or ecosystem wallets, do not set the scripting define and remove any references to WalletProvider.ReownWallet.
Search the project for the removed enum values and update the call sites.
Other call-site adjustments:
- Remove any arguments named
legacyEncryptionKeywhen instantiatingInAppWalletOptionsorEcosystemWalletOptions. - Replace checks for
WalletProvider.PrivateKeyWalletwith direct usage of the .NETPrivateKeyWallethelpers, e.g.await PrivateKeyWallet.Generate(client). - When you need to filter wallets in Reown, set
IncludedWalletIds/ExcludedWalletIdsinside theReownOptionsobject instead of relying on the removedIncludedWalletIdsarray.
SmartWalletOptions retained the same fields, so your upgrade code should compile unchanged. What does change is the surrounding manager state:
UpgradeToSmartWalletno longer adds the smart wallet to a shared dictionary; it simply returns the new wallet and setsActiveWallet.LinkAccountstill exists but now reads the redirect settings fromThirdwebManagerBase’s remaining fields. Confirm any login UI that referencedRedirectPageHtmlOverridestill points to a valid asset.
- Delete deprecated prefabs (
WalletConnectModal, old MetaMask UI, etc.). - Remove scripts that referenced the dropped enum values so Unity stops warning about missing behaviours.
- Clear serialized ScriptableObjects that kept
legacyEncryptionKey,SupportedChains, orIncludedWalletIds. - Update internal docs to mention Reown and the new optional dependency model.
Missing script warnings
If Unity reports missing MonoBehaviours after the upgrade, open the affected prefab or scene, remove the broken component, and rewire it using the v6 APIs.
- Open Play mode and confirm each wallet flow works (In-App, Ecosystem, and optionally Reown).
- Test the auto-connect flow to verify that
PlayerPrefsstores the newWalletOptionspayload. - Build for every platform you support; Reown builds will fail if the AppKit prefab or define is missing.
- Run any automated gameplay/contract tests to ensure async interactions behave identically.