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
Copy file name to clipboardExpand all lines: src/connections/sources/catalog/libraries/server/node/index.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -284,6 +284,7 @@ Setting | Details
284
284
`flushInterval` _number_ | The number of milliseconds to wait before flushing the queue automatically. The default is: `10000`
285
285
`httpRequestTimeout` | The maximum number of milliseconds to wait for an http request. The default is: `10000`
286
286
`disable` | Disable the analytics library for testing. The default is: `false`
287
+
`httpClient` | Optional custom AnalyticsHTTPClient implementation to support alternate libraries or proxies. Defaults to global fetch or node-fetch for older versions of node.
287
288
288
289
## Graceful shutdown
289
290
Avoid losing events after shutting down your console. Call `.closeAndFlush()` to stop collecting new events and flush all existing events. If a callback on an event call is included, this also waits for all callbacks to be called, and any of their subsequent promises to be resolved.
@@ -553,7 +554,44 @@ Different parts of your application may require different types of batching, or
553
554
const marketingAnalytics = new Analytics({ writeKey: 'MARKETING_WRITE_KEY' });
554
555
const appAnalytics = new Analytics({ writeKey: 'APP_WRITE_KEY' });
555
556
```
557
+
## AnalyticsHTTPClient
556
558
559
+
In some cases such as supporting an environment with an http proxy in place, you may need to use something other than our multiplatform `fetch` call. You can create a custom `AnalyticsHTTPClient` implementation and pass it in to the Analytics Configuration.
560
+
561
+
An example of supporting proxies with a popular library, axios:
562
+
```javascript
563
+
const axios = require('axios')
564
+
565
+
export class ProxyAxiosClient implements AnalyticsHTTPClient {
0 commit comments