# ReportServiceSettings

## Content

# Interface: ReportServiceSettings

Describes the settings to connect the Web API.

## Properties

### onRequest?

```ts
optional onRequest?: Function;
```

Callback before any request.
Allows to change RequestInit object before fetch request - https://fetch.spec.whatwg.org/#requestinit.

#### Example

```javascript
   onRequest: (init) => init.headers.Authorization = 'security_token';
```

***

### onRequestAsync?

```ts
optional onRequestAsync?: (init) => Promise<RequestInit>;
```

Callback before any request.
Allows to change RequestInit object before fetch request - https://fetch.spec.whatwg.org/#requestinit.

#### Parameters

##### init

`RequestInit`

#### Returns

`Promise`&lt;`RequestInit`&gt;

#### Example

```javascript
   onRequestAsync: (init) => {
       return new Promise((resolve, reject) => {
           init.headers.Authorization = 'security_token';
           return resolve(init);
   });
```

***

### securityToken?

```ts
optional securityToken?: string;
```

The security key needed to access the Web API.

#### Example

```javascript
securityToken: 'security_token',
```

***

### url?

```ts
optional url?: string;
```

The url to connect the Web API.

#### Examples

```javascript
url: '/api/reporting' // default value
```

```javascript
url: 'http:example.com/api/reporting'
```
