useDeleteUserAccount
Introduction
This guide shows you how to implement account deletion functionality without using Dynamic’s UI components. When a user deletes their account, all associated data will be permanently removed, including their wallets, embedded wallets, verified credentials, etc.
Account deletion is permanent and cannot be undone. All associated data will be irrecoverably deleted.
Implementation
The account deletion functionality is accessed through the useDeleteUserAccount
hook from the SDK.
This hook requires Dynamic SDK version 4.6 or higher. Make sure you’re using a compatible version to access this functionality.
Basic Implementation
Here’s a simple implementation showing how to add account deletion to your app:
Best Practices
-
Always confirm deletion: Include a confirmation step before proceeding with account deletion.
-
Clear explanation: Clearly explain what data will be deleted and that the action is permanent.
Hook Types and Functions
The useDeleteUserAccount
hook provides:
deleteUser
: Function to initiate account deletionisLoading
: Boolean indicating if deletion is in progresserror
: Error object if deletion fails
Was this page helpful?