@algolia/client-search 5.3.0 → 5.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.d.cts CHANGED
@@ -2976,7 +2976,7 @@ type ReplaceAllObjectsOptions = {
2976
2976
  batchSize?: number;
2977
2977
  };
2978
2978
 
2979
- declare const apiClientVersion = "5.3.0";
2979
+ declare const apiClientVersion = "5.3.1";
2980
2980
  declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
2981
2981
  transporter: _algolia_client_common.Transporter;
2982
2982
  /**
package/dist/node.d.ts CHANGED
@@ -2976,7 +2976,7 @@ type ReplaceAllObjectsOptions = {
2976
2976
  batchSize?: number;
2977
2977
  };
2978
2978
 
2979
- declare const apiClientVersion = "5.3.0";
2979
+ declare const apiClientVersion = "5.3.1";
2980
2980
  declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
2981
2981
  transporter: _algolia_client_common.Transporter;
2982
2982
  /**
@@ -25,7 +25,7 @@ __export(searchClient_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(searchClient_exports);
27
27
  var import_client_common = require("@algolia/client-common");
28
- var apiClientVersion = "5.3.0";
28
+ var apiClientVersion = "5.3.1";
29
29
  function getDefaultHosts(appId) {
30
30
  return [
31
31
  {
@@ -119,7 +119,11 @@ function createSearchClient({
119
119
  * @param params.apiKey - The new API Key to use.
120
120
  */
121
121
  setClientApiKey({ apiKey }) {
122
- this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
122
+ if (!authMode || authMode === "WithinHeaders") {
123
+ this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
124
+ } else {
125
+ this.transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
126
+ }
123
127
  },
124
128
  /**
125
129
  * Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.