Documentation Index
Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
deleteUser performs a hard delete of the authenticated user. All associated data — wallets, embedded wallets, verified credentials, metadata — is permanently removed. Once the API call succeeds, the SDK automatically logs the user out and clears all client-side authentication state.
Usage
- JavaScript
- React
Behavior
- Requires an authenticated user — call only when
isSignedInreturnstrue. - The API call is gated by MFA: if the user has MFA enabled and the action requires step-up, you’ll see an MFA challenge surface. Handle it with
isMfaRequiredForActionbefore invokingdeleteUser. - On success, the client emits
logout(withreason: 'user-deleted') anduserChanged({ user: null }). Subscribe viaonEventor use the React hookuseUserto react to the change.
Best practices
- Confirm first. Always require an explicit confirmation step (a typed-in account name or a “Delete” word match works well).
- Explain scope. Tell the user what is removed — wallets, balances, credentials, metadata — and that the action is irreversible.
- Clear local state. If you cache user data outside the SDK (Redux, query caches, IndexedDB), clear it on success.
Related functions
- Logout — log the user out without deleting their data
- Update User — change profile fields
- User & Session Management