@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.
@@ -19,7 +19,7 @@ import {
19
19
  ApiError,
20
20
  createIterablePromise
21
21
  } from "@algolia/client-common";
22
- var apiClientVersion = "5.3.0";
22
+ var apiClientVersion = "5.3.1";
23
23
  function getDefaultHosts(appId) {
24
24
  return [
25
25
  {
@@ -113,7 +113,11 @@ function createSearchClient({
113
113
  * @param params.apiKey - The new API Key to use.
114
114
  */
115
115
  setClientApiKey({ apiKey }) {
116
- this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
116
+ if (!authMode || authMode === "WithinHeaders") {
117
+ this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
118
+ } else {
119
+ this.transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
120
+ }
117
121
  },
118
122
  /**
119
123
  * Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.