# Accounts

<figure><img src="https://3844357853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLWWF0gTSzvFs1o4Cs6Tm%2Fuploads%2FjwNRTjT0cC6IfHEinKtE%2Faccounts-light.png?alt=media&#x26;token=53a690b6-bae3-44a3-9536-9cc9263b732f" alt=""><figcaption><p>Accounts</p></figcaption></figure>

## Configuration <a href="#configuration" id="configuration"></a>

Set up a new instance with `config` parameters and `set`/`get` methods:

```javascript
const accounts = appmixer.ui.Accounts(config)

accounts.set(key, value)
accounts.get(key)
```

#### **`config.el`** **`...`**

{% hint style="info" %}
Learn about `widget` `config` [here](https://docs.appmixer.com/6.0/5.0/appmixer-sdk/ui-and-widgets/..#configuration).
{% endhint %}

## Instance <a href="#state" id="state"></a>

{% hint style="info" %}
Learn about `widget` instance [here](https://docs.appmixer.com/6.0/5.0/appmixer-sdk/ui-and-widgets/..#instance).
{% endhint %}

### State

```javascript
accounts.state(name, value)
```

#### **`loader`**

Type: `Boolean` | Default: `null`

Toggle a custom loading state.

#### **`error`**

Type: `String` | Default: `null`

Toggle a custom error message.

### Events <a href="#events" id="events"></a>

```javascript
accounts.on(event, handler)
```

#### **`flow:open`**

```javascript
accounts.on('flow:open', flowId => {/* ... */})
```

Select a flow to open in **Designer** widget.

## Example

```javascript
const accounts = appmixer.ui.Accounts({
    el: '#accounts'
})

accounts.open()
```
