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
+66Lines changed: 66 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* | A 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,72 @@ 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
+
Segment attempts to use the global `fetch` implementation if available in order to support several diverse environments. Some special cases (for example, http proxy) may require a different implementation for http communication. You can provide a customized wrapper in the Analytics configuration to support this. Here are a few approaches:
560
+
561
+
Use a custom fetch-like implementation with proxy (simple, recommended)
0 commit comments