Overview
useRemoveAccount signs out and removes a specific account from the stored accounts map. It sends a best-effort sign-out request to the server to revoke the account’s refresh token family before removing local state.
If the removed account is the currently active one, the SDK automatically switches to the next available account. If no other accounts remain, the SDK resets to the unauthenticated state.
Usage Example
Parameters
The hook returns aremoveAccount function that accepts:
The ID of the account to remove.
Returns
Async function that removes the specified account. Throws synchronously if
userId is not found in the accounts map or if no projectId is available.
Runtime errors during removal are caught and surfaced via the error field
instead of throwing.true while the removal is in progress.Error message if the removal failed, or
null if no error occurred.
