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
WalletProvider
enum now only exposesInAppWallet
,EcosystemWallet
, andReownWallet
.PrivateKeyWallet
,WalletConnectWallet
, andMetaMaskWallet
handlers were removed from the manager. - Reown integration – External wallets are unified under the optional
ReownWallet
provider. Support is wrapped in#if THIRDWEB_REOWN
guards and requires Reown AppKit in your project. - Option models –
EcosystemWalletOptions
andInAppWalletOptions
no longer acceptlegacyEncryptionKey
.WalletOptions
gained aReownOptions
payload that is filled with sensible defaults when omitted. - Manager internals –
SupportedChains
,IncludedWalletIds
, and the_walletMapping
accessors were deleted.ConnectWallet
now setsActiveWallet
directly and only persists the most recent wallet for auto-connect. - Version + diagnostics –
THIRDWEB_UNITY_SDK_VERSION
jumped to6.0.0
, and the boot sequence logs an explicit error ifTHIRDWEB_REOWN
is 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_REOWN
to Player Settings → Other Settings → Scripting Define Symbols for every build target that uses external wallets. - Drop the
Reown AppKit
prefab 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
legacyEncryptionKey
when instantiatingInAppWalletOptions
orEcosystemWalletOptions
. - Replace checks for
WalletProvider.PrivateKeyWallet
with direct usage of the .NETPrivateKeyWallet
helpers, e.g.await PrivateKeyWallet.Generate(client)
. - When you need to filter wallets in Reown, set
IncludedWalletIds
/ExcludedWalletIds
inside theReownOptions
object instead of relying on the removedIncludedWalletIds
array.
SmartWalletOptions
retained the same fields, so your upgrade code should compile unchanged. What does change is the surrounding manager state:
UpgradeToSmartWallet
no longer adds the smart wallet to a shared dictionary; it simply returns the new wallet and setsActiveWallet
.LinkAccount
still exists but now reads the redirect settings fromThirdwebManagerBase
’s remaining fields. Confirm any login UI that referencedRedirectPageHtmlOverride
still 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
PlayerPrefs
stores the newWalletOptions
payload. - 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.