Before you start
Follow Accounts to register your application and initialize the sharedoneAuth client. The example below uses @rhinestone/1auth version 0.10.2.
Open the connection dialog
Create one provider around your existing client and reuse it throughout your application:provider.ts
wallet_connect from your application’s connect button:
connect.ts
Connect MetaMask
- Open the connection dialog from your application.
- Choose Continue with wallet, then select MetaMask from the available wallets.
- Approve the connection in MetaMask.
- Use the returned address as the active account.
wallet_connect is the provider method that opens the chooser. It is not the WalletConnect protocol.Choose when to offer external wallets
Use the provider method that matches the action in your interface:
Keep using the same provider after connection. It routes signing and transaction requests to the selected wallet; do not call the embedded client’s transaction methods to transact from an external address.
Use your own connection UI
If your application already has a wallet picker, usecreateOneAuthConnection instead of opening the SDK’s chooser. Supply two callbacks:
selectConnection: return"passkey"or"external_wallet"for the user’s choice.connectExternalWallet: connect through your wallet integration and return its EIP-1193 provider, selected address, and numeric chain ID.
accountAddress, provider, and signerType. Use the returned provider for subsequent wallet requests. The helper does not discover wallets or build a picker for you, and does not try the other connection method if the selected one fails.
External and embedded accounts stay separate
External-wallet requests use the selected wallet’s signing and transaction flow, rather than the embedded wallet’s managed intent path. Connecting does not automatically enable embedded-wallet sponsorship, session keys, recovery, or multichain execution for the external account. A wallet connection also does not, by itself, establish an authenticated backend session for your application.Next steps
- Use and manage connected wallets for signing, transactions, account changes, and disconnection.
- Ecosystem for provider, viem, and wagmi integration.