Skip to content

Commit d5f490d

Browse files
committed
chore: add notes on Node.js-only functionality for https agent in BaseRestClient and update import type in WebSocket client
1 parent 2b29349 commit d5f490d

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/lib/BaseRestClient.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import axios, { AxiosRequestConfig, AxiosResponse, Method } from 'axios';
2+
// NOTE: https.Agent is Node.js-only and not available in browser environments
3+
// Browser builds (via webpack) exclude this module - see webpack.config.js fallback settings
24
import https from 'https';
35
import { nanoid } from 'nanoid';
46

@@ -171,6 +173,9 @@ export abstract class BaseRestClient {
171173
}
172174

173175
// If enabled, configure a https agent with keepAlive enabled
176+
// NOTE: This is Node.js-only functionality. In browser environments, this code is skipped
177+
// as the 'https' module is excluded via webpack fallback configuration.
178+
// Browser connection pooling is handled automatically by the browser itself.
174179
if (this.options.keepAlive) {
175180
// Extract existing https agent parameters, if provided, to prevent the keepAlive flag from overwriting an existing https agent completely
176181
const existingHttpsAgent = this.globalRequestOptions.httpsAgent as

src/types/websockets/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ClientRequestArgs } from 'http';
1+
import type { ClientRequestArgs } from 'http';
22
import WebSocket from 'isomorphic-ws';
33

44
/** General configuration for the WebsocketClient */

0 commit comments

Comments
 (0)