# DeleteUser

{% hint style="danger" %}
Please note that this operation is non-reversible. User funds will not be recoverable once deleted unless they have backed up their private key.
{% endhint %}

## Description

Deletes the user's encrypted wallets, the Metafi share and the user's share on their device. Renders the wallet unrecoverable.

## Details

### Signature

`async DeleteUser(apiKey)`

### Arguments

<table><thead><tr><th width="258">Parameter</th><th width="114">Type</th><th>Definition</th></tr></thead><tbody><tr><td><code>apiKey</code></td><td>String</td><td>The API Key generated from the <a href="https://developer-test.usemeta.fi/">Developer Portal</a></td></tr></tbody></table>

### Return Value

This function returns a `Promise` that resolves to the following object:

```json
{
    "statusCode": 1/0,
    "data": "data" // always null
    "error": "error" // error if any, else null
}
```

## Example

{% code title="" lineNumbers="true" %}

```jsx
import { DeleteUser } from '@metafi/metafi-js-package';

function App() {

    const handleDeleteUser = async () => {
        var result = await DeleteUser("YOUR-API-KEY");
        console.log("result after deleting user", result);
    }
    
    return (
        <div>
	    <button onClick={handleDeleteUser}>Delete your Wallet</button>
        </div>
    );
}

export default App;

```

{% endcode %}
