Android examples for integrating MetaMask Embedded Wallets (formerly Web3Auth Plug and Play) into native Android applications. The SDK is written in Kotlin and provides social login, custom authentication, and blockchain interactions without requiring users to manage private keys.
| Example | Description |
|---|---|
| android-quick-start | Basic integration with social login and EVM (Sepolia) |
| android-auth0-example | Custom authentication via Auth0 JWT flow |
| android-firebase-example | Custom authentication via Firebase ID token |
| android-aggregate-verifier-example | Grouped connections — same wallet across Google + Email Passwordless |
| android-solana-example | Solana integration using sol4k and Jetpack Compose |
| android-playground | Full-featured playground with all SDK capabilities |
- Clone this repository:
git clone https://github.com/Web3Auth/web3auth-android-examples.git
- Open the example directory of your choice in Android Studio.
- Create a project on the Embedded Wallets Dashboard and get your Client ID.
- Allowlist your app's redirect URI on the dashboard:
{YOUR_APP_PACKAGE_NAME}://auth - Set your Client ID in the example's
app/src/main/res/values/strings.xml. - Follow the individual example README for any provider-specific configuration.
- Run on a device or emulator (API 26+).
- Android Studio Hedgehog (2023.1.1) or later
- Android API 26 or newer
- Compile SDK 34
- JDK 17+
- Kotlin 1.9.24 (required by SDK 11)
All examples use com.github.web3auth:web3auth-android-sdk:11.0.0 (Auth v11 citadel sessions, Wallet Services v6). This matches the SDK sample app and the recent Flutter and iOS example updates.
- Construct
Web3Auth, pass the redirect withsetResultUrl(), then callinitialize()so an existing citadel session can be restored. Single-factor auth falls back to session-service when citadel authorize fails. - Social and custom login use
connectTo(LoginParams(...)). - After login, use
getUserInfoAsync()for token-backed profile data,getAccessToken()for the citadel access token, andrefreshSession()to re-authorize. enableMFA()andmanageMFA()take no arguments. Custom JWT login (Firebase) is single-factor auth, and the SDK rejects MFA on that path.- Set
authBuildEnv = BuildEnv.PRODUCTIONfor Sapphire Mainnet client IDs.BuildEnv.TESTINGtargets develop-auth and fails redirect checks for production projects. - Leave
sessionTimeunset soinitialize()reads it from the dashboard project config. - Do not hard-code
/v10auth or dashboard URLs. The SDK defaults to/v11.
- Package:
com.github.web3auth:web3auth-android-sdk - Current version used in examples:
11.0.0 - Latest releases: github.com/Web3Auth/web3auth-android-sdk/releases
- Android SDK Documentation
- MetaMask Embedded Wallets Docs
- Dashboard
- Builder Hub Community
- GitHub Issues
MIT — see LICENSE for details.