You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`option` is an object with the following properties, all of which are optional. If `option` is not defined, host name will be applied for all requests.
412
+
-**searchApiRequestOnly**: If true, the new host name is only applied for searchApi requests (default: false)
413
+
-**statsApiRequestOnly**: If true, the new host name is only applied for statsApi requests (default: false)
411
414
```js
412
415
// Set API hostname (e.g. for dedicated environments)
413
416
client.setApiHostname('api.addsearch.com');
414
417
```
415
418
419
+
#### Set API request interceptor
420
+
`configurationObject` contains 2 keys: <string>`url` and <object>`headers`. Modify the `configurationObject` before it is sent.
421
+
422
+
`option` is an object with the following properties, all of which are optional. If `option` is not defined, the interceptor will be used for all requests.
423
+
-**searchApiRequestOnly**: If true, the interceptor is only used for searchApi requests (default: false)
424
+
-**statsApiRequestOnly**: If true, the interceptor is only used for statsApi requests (default: false)
425
+
426
+
```js
427
+
functioncallback(configurationObject) {
428
+
configurationObject.headers['X-Api-Key'] ='YOUR API KEY';
0 commit comments