# 02. __Configuration__

[![+Professional Support](https://www.totaljs.com/img/badge-support.svg)](https://www.totaljs.com/support/) [![+Chat with contributors](https://www.totaljs.com/img/badge-chat.svg)](https://messenger.totaljs.com)

Configuration can be changed in the app `/config` file by adding the code below. If the `/config` file doesn't exist then create it `/yourapp/config` as a plain text file without file extension.

```html
package#flow      (Object) : { auth: ['username:password'], dark: true }
```

## Flow options

- [`auth`](#property-auth-)
- [`backup`](#property-backup-)
- [`dark`](#property-dark-)
- [`debug`](#property-debug-)
- [`limit`](#property-limit-)
- [`restrictions`](#property-restrictions-)
- [`templates`](#property-templates-)
- [`templates2`](#property-templates2-)
- [`components`](#property-components-)
- [`components2`](#property-components2-)
- [`token`](#property-token-)
- [`url`](#property-url-)

#### Property: `auth`

Enables authorization. This property can have two types of value.

```javascript
auth = true;
// {Booelan}
// Enables Total.js authorization via F.onAuthorize delegate.
// In other words: Flow adds "authorize" flag to own routes

auth = ['username:password', 'petersirka:123456'];
// {String Array}
// Enables HTTP Basic authorization
```

#### Property: `backup`

`+v4.1.0` Enables backing up of settings for Flow designer.

```javascript
backup;
// {Boolean}
// Default value: false
```

#### Property: `crashmode`

`+v4.3.0` Enables crash mode (the flow won't be applied after start). __IMPORTANT:__ crash mode can be enabled via command line `node yourflowapp.js --crashmode`

```javascript
crashmode;
// {Boolean}
// Default value: false
```

#### Property: `components`

`+v6` An absolute URL address to Flow pred-defined components.

```javascript
components;
// {String}
// Default value: "https://cdn.totaljs.com/flow/list.json"
```

#### Property: `components2`

`+v6` An absolute URL address to second Flow pred-defined components. It was added because some developers wanted to use main components and own components together.

```javascript
components2;
// {String}
// Default value: ""
```

#### Property: `dark`

Enables `dark` theme as default. Otherwise the theme will be __light__.

```javascript
dark;
// {Boolean}
// Default value: false
```

#### Property: `debug`

`+v4.1.0` Enables monitoring of component files. If some file will be modified then the Flow refresh it.

```javascript
debug;
// {Boolean}
// Default value: false
```

#### Property: `limit`

A maximum size limit for received message through the WebSocket

```javascript
limit;
// {Number}
// Default value: 150
```

#### Property: `restrictions`

Enables IP restrictions for the specified IP addresses.

```javascript
restrictions = ['127.0.0.1', '62.168.127.195'];
// {String Array}
// Default: null
```

#### Property: `templates`

An absolute URL address to Flow pred-defined templates.

```javascript
templates;
// {String}
// Default value: "https://cdn.totaljs.com/flow/templates/list.json"
```

#### Property: `templates2`

`+v7` An absolute URL address to second Flow pred-defined templates. It was added because some developers wanted to use main templates and own templates together.

```javascript
templates2;
// {String}
// Default value: ""
```

#### Property: `token`

Enables tokens authorization. In other words: URL address must contain a `token` query parameter.

```javascript
token = ['OUR_COMPANY_TOKEN'];
// {String Array}
// Enables token
// It works in the form: /$flow/?token=OUR_COMPANY_TOKEN
// Default: null
```

#### Property: `updates`

`+v4.3.0` Enables auto-check updates if the user opens components.

```javascript
updates;
// {Boolean}
// Default value: true
```

#### Property: `url`

A relative URL address for Flow designer.

```javascript
url;
// {String}
// Default value: "/$flow/"
```