Add Dexter Sign-In
Use useDexterConnection to connect a Dexter account and DexterButton to render the control. The SDK opens the passkey flow and verifies that the returned account and wallet belong together.
Install
In a React 18 or newer application:
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 page. The SDK supplies the button mark, interaction states, and styles.
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, wallet creation, connection states, and styling.
Last Updated: