Account Access
This React example signs someone in to your app with a passkey from the earlier Dexter Wallet. useDexterConnection opens the passkey prompt and verifies that the returned account and wallet belong together. DexterAccountControl displays the account panel.
Install
These versions of Connect and Vault support the earlier Wallet integration in React 18 or later. To build with the new on-chain Dexter Account, request beta access.
On third-party origins, sign-in opens Dexter's hosted authorization window.
- The SDK opens the hosted Dexter authorization window.
- The wallet owner approves with their passkey.
- Dexter returns the account session and wallet identity. The SDK verifies their relationship.
- Your application installs the returned account session before revealing account content.
Add the Control
This React client component stores its session in memory. Reloading clears it; connect your application's session adapter for persistence.
Render <DexterSignIn /> in your header. The SDK supplies the account mark, panel, balance reader and interaction states. For wallet operations, use intent: 'wallet' and gate your app's actions on the returned permissions.
Reuse one connection instance across your app. Pass navigation to replace hosted destinations with local routes, and items for app-specific links. The reference lists these options.
Connect Your Session Store
Replace the two callbacks with your app's authentication adapter:
installAccountSession(session)installs the returned session and updatesaccountSessionwith that same access token. Reject if installation fails.- Clear the host session inside
clearAccountSession()and update the state tosigned_out. - While restoring a stored session, pass
{ status: 'loading' }. Update it after restoration completes.
Keep tokens and wallet identity proofs out of logs and page markup. Gate account content on model.permissions.accountContentVisible; the SDK keeps it unavailable while verification runs or identities conflict. Your backend must also authenticate and authorize its own requests.
Check the Integration
Click the control, complete the Dexter passkey prompt, and return to the app. The connected identity should appear after verification. Cancel a prompt and confirm that no connected state appears. Disconnect and confirm that account content disappears.
See Connect Reference for result fields, the earlier Wallet creation flow, connection states, and styling.
Last Updated: