# decrypt

{% hint style="info" %}
decrypt method returns a promise which **resolves** when Dashboard successfully decrypted your payload and **rejects** if missing requirements or if something went wrong with Dashboard encryption api.
{% endhint %}

### How to use

```jsx
import { Plugin } from '@root'

Plugin.decrypt({
    ...DECRYPT_PARAMS
}).then(data).catch(error)
```

### Decrypt params

| Param        | Typeof | Default | Required | Description                                          |
| ------------ | ------ | ------- | :------: | ---------------------------------------------------- |
| **payload**  | String | null    |     ✅    | the data that you want Dashboard to decrypt for you. |
| **password** | String | null    |     ✅    | the decryption password to use to decrypt your data. |

#### Examples

### Decrypt data

```jsx
import { Plugin } from '@root'

const encryptedData = "elkrjkelwrj#RJGSDG=!fDSFJFSDjfsdihjge==!!DFEhg"

Plugin.decrypt({
    payload: encryptedData,
    password: 'my-super-secret-password'
}).then(decryptedData => {
    console.log(decryptedData)
}).catch(error => {
    console.error(error)
})
```
