···131131 }
132132133133 /**
134134+ * Merges new query parameters without triggering a reconnection.
135135+ * The updated params take effect on the next connection attempt
136136+ * (e.g., when the built-in reconnection fires after a disconnect).
137137+ *
138138+ * @param params - Key-value pairs to merge into the current query parameters.
139139+ *
140140+ * @example
141141+ * ```typescript
142142+ * // Update cursor on disconnect so reconnection resumes from last position
143143+ * client.on("close", () => {
144144+ * client.setParams({ cursor: lastEventId });
145145+ * });
146146+ * ```
147147+ */
148148+ setParams(params: Record<string, string | number | boolean>): void {
149149+ this.connection.setParams(params);
150150+ }
151151+152152+ /**
134153 * Returns a read-only snapshot of the current connection state.
135154 */
136155 getConnectionInfo(): ConnectionInfo {
+10
src/connection/WebSocketConnection.ts
···119119 }
120120121121 /**
122122+ * Merges new query parameters without triggering a reconnection.
123123+ * The updated params will take effect on the next connection attempt
124124+ * (e.g., after a disconnect triggers the built-in reconnection).
125125+ */
126126+ setParams(params: Record<string, string | number | boolean>): void {
127127+ this.queryParams = { ...this.queryParams, ...params };
128128+ this.logger.debug("Query params set (no reconnect)", { params: this.queryParams });
129129+ }
130130+131131+ /**
122132 * Returns a read-only snapshot of the current connection state.
123133 */
124134 getConnectionInfo(): ConnectionInfo {