[]
Describes the settings to connect the Web API.
optional onRequest: Function;
Callback before any request. Allows to change RequestInit object before fetch request - https://fetch.spec.whatwg.org/#requestinit.
onRequest: (init) => init.headers.Authorization = 'security_token';
optional onRequestAsync: (init) => Promise<RequestInit>;
Callback before any request. Allows to change RequestInit object before fetch request - https://fetch.spec.whatwg.org/#requestinit.
RequestInit
Promise
<RequestInit
>
onRequestAsync: (init) => {
return new Promise((resolve, reject) => {
init.headers.Authorization = 'security_token';
return resolve(init);
});
optional securityToken: string;
The security key needed to access the Web API.
securityToken: 'security_token',
optional url: string;
The url to connect the Web API.
url: '/api/reporting' // default value
url: 'http:example.com/api/reporting'