# Delete User Account Component

PropelAuth's Delete User Account component allows you to customize the flow around a user deleting their account in your app.

---

## Delete Account

---

## [Shadcn Installation](https://ui.propelauth.com/account-page-components/delete-user-account#shadcn-installation)

Install this component from our [shadcn registry](https://ui.propelauth.com/getting-started/component-registry).

```bash
npx shadcn@latest add https://components.propelauth.com/r/delete-user-account.json
```

---

# Reference APIs

These are the APIs that are used by the above component. You can use these APIs directly in your own code.

## [deleteAccount](https://ui.propelauth.com/account-page-components/delete-user-account#delete-account)

Deletes the logged in user's account from your application.

## Response Functions

The response object has a **handle** function that you can use to handle the response. These functions can be async, and you can return values from them.

- Name `success` Description Successful request.
- Name `actionDisabled` Description The 'Users can delete their own accounts' setting in your PropelAuth dashboard is disabled.
- Name `unauthorized` Description The user is not logged in.
- Name `unexpectedOrUnhandled` Description An unexpected error occurred.

### Request

```javascript
const { deleteAccount } = useAuthFrontendApis()

const response = await deleteAccount()
await response.handle({
    success: async () => {
        console.log('Account deleted')
    },
    actionDisabled(error) {
        console.log('Cannot delete account', error.user_facing_error)
    },
    unexpectedOrUnhandled(error) {
        console.log('Unexpected or unhandled error', error.user_facing_error)
    },
})
```

### Successful Response

```
{}
```
