Skip to main content

🚀 Migrating to Web3Auth PnP Modal SDK v10

Web3Auth v10 streamlines your authentication experience by centralizing all setup in the Developer Dashboard, removing the complexity of adapters, verifiers, and manual blockchain configuration.

Recommended: Before upgrading, ensure you’re using the latest Web3Auth v9.x to receive helpful deprecation warnings and simplify the migration process.


📥 Installation

Start by updating your dependencies to use the latest v10 release:

npm install @web3auth/modal@latest
# or
yarn add @web3auth/modal@latest

⚠️ Note: Ensure removal of deprecated packages like @web3auth/base.


🧹 Migration Steps

To migrate effectively, proceed in the following logical order:

  1. Update Authentication Configuration
  2. Remove Adapter Setup
  3. Simplify Chain and Key Provider Setup
  4. Update Modal Configuration
  5. Switch to React Hooks (if applicable)
  6. Update Blockchain RPC Usage
  7. Review Deprecated Features

1. Update Authentication Configuration

Replace verifier and verifierSubIdentifier with dashboard-based identifiers:

loginConfig: {
google: {
verifier: "aggregate-verifier",
verifierSubIdentifier: "w3a-google",
typeOfLogin: "google",
clientId: "<GOOGLE_CLIENT_ID>",
},
}

Benefit: Automatic account linking via dashboard, reducing frontend complexity.


2. Remove Adapter Setup

Adapters like AuthAdapter are fully removed. Migrate directly to connectors:

import { AuthAdapter } from "@web3auth/auth-adapter";

const authAdapter = new AuthAdapter(adapterSettings);
web3auth.configureAdapter(authAdapter);

Result: Cleaner, zero-import setup.


3. Simplify Chain and Key Provider Setup

Manual privateKeyProvider and chainConfig are deprecated. Now fully dashboard-driven:

const chainConfig = getEvmChainConfig(chainId, clientId);
const privateKeyProvider = new EthereumPrivateKeyProvider({ config: { chainConfig } });

const web3auth = new Web3Auth({
clientId,
privateKeyProvider,
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
});

4. Update Modal Configuration

Move modalConfig setup directly into the SDK constructor:

await web3auth.initModal({
modalConfig: { ... },
});

5. Switch to React Hooks (if applicable)

React apps must migrate from class-based methods to hooks provided by @web3auth/modal/react:

const web3auth = new Web3Auth({ ... });
await web3auth.initModal();
await web3auth.connect();

6. Update Blockchain RPC Usage (React only)

React-based blockchain RPC calls should now use wagmi hooks:

const rpc = new EthereumRpc(provider);
await rpc.getAccounts();
await rpc.signMessage();

7. Review Deprecated Features

Plan for future removal of deprecated features:

Featurev10 StatusAction required
@web3auth/base packageDeprecatedReplace with @web3auth/modal
privateKeyProviderRemovedDashboard-managed
Class-based React usageRemovedSwitch to hooks
Adapters (AuthAdapter, etc.)RemovedUse connectors

🚦 Framework Compatibility Table

FrameworkClass-based usageReact hooksWagmi RPC
React❌ Unsupported✅ Required✅ Recommended
Angular✅ SupportedN/AN/A
Vue✅ SupportedN/AN/A
Vanilla✅ SupportedN/AN/A

🎯 Summary & Next Steps

  • Review: Verify you've addressed all breaking changes.
  • Testing: Thoroughly test your migrated application.
  • Support: Reach out via our community forums for help.

📖 Additional Resources