diff --git a/packages/algoliasearch/__tests__/algoliasearch.common.test.ts b/packages/algoliasearch/__tests__/algoliasearch.common.test.ts index 141d0ec85..ffdcf3b9a 100644 --- a/packages/algoliasearch/__tests__/algoliasearch.common.test.ts +++ b/packages/algoliasearch/__tests__/algoliasearch.common.test.ts @@ -20,6 +20,10 @@ describe('api', () => { expect(client.appId).toEqual('APP_ID'); }); + test('exposes the `apiKey` currently in use at the root of the API', () => { + expect(client.apiKey).toEqual('API_KEY'); + }); + test('provides a `clearCache` method', () => { expect(client.clearCache).not.toBeUndefined(); expect(() => client.clearCache()).not.toThrow(); diff --git a/packages/algoliasearch/lite/src/liteClient.ts b/packages/algoliasearch/lite/src/liteClient.ts index 9739dc610..93eb621d3 100644 --- a/packages/algoliasearch/lite/src/liteClient.ts +++ b/packages/algoliasearch/lite/src/liteClient.ts @@ -96,6 +96,11 @@ export function createLiteClient({ */ appId: appIdOption, + /** + * The `apiKey` currently in use. + */ + apiKey: apiKeyOption, + /** * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. */ diff --git a/packages/client-abtesting/src/abtestingClient.ts b/packages/client-abtesting/src/abtestingClient.ts index 6166363ac..a0ff0c8e8 100644 --- a/packages/client-abtesting/src/abtestingClient.ts +++ b/packages/client-abtesting/src/abtestingClient.ts @@ -79,6 +79,11 @@ export function createAbtestingClient({ */ appId: appIdOption, + /** + * The `apiKey` currently in use. + */ + apiKey: apiKeyOption, + /** * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. */ diff --git a/packages/client-analytics/src/analyticsClient.ts b/packages/client-analytics/src/analyticsClient.ts index 7d3ec14f5..d0d4e35f9 100644 --- a/packages/client-analytics/src/analyticsClient.ts +++ b/packages/client-analytics/src/analyticsClient.ts @@ -106,6 +106,11 @@ export function createAnalyticsClient({ */ appId: appIdOption, + /** + * The `apiKey` currently in use. + */ + apiKey: apiKeyOption, + /** * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. */ diff --git a/packages/client-composition/src/compositionClient.ts b/packages/client-composition/src/compositionClient.ts index 10578b00b..ac18a3231 100644 --- a/packages/client-composition/src/compositionClient.ts +++ b/packages/client-composition/src/compositionClient.ts @@ -113,6 +113,11 @@ export function createCompositionClient({ */ appId: appIdOption, + /** + * The `apiKey` currently in use. + */ + apiKey: apiKeyOption, + /** * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. */ diff --git a/packages/client-insights/src/insightsClient.ts b/packages/client-insights/src/insightsClient.ts index 4e499fb40..27d00ecf8 100644 --- a/packages/client-insights/src/insightsClient.ts +++ b/packages/client-insights/src/insightsClient.ts @@ -69,6 +69,11 @@ export function createInsightsClient({ */ appId: appIdOption, + /** + * The `apiKey` currently in use. + */ + apiKey: apiKeyOption, + /** * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. */ diff --git a/packages/client-personalization/src/personalizationClient.ts b/packages/client-personalization/src/personalizationClient.ts index 5e2ea8519..98fba2e16 100644 --- a/packages/client-personalization/src/personalizationClient.ts +++ b/packages/client-personalization/src/personalizationClient.ts @@ -73,6 +73,11 @@ export function createPersonalizationClient({ */ appId: appIdOption, + /** + * The `apiKey` currently in use. + */ + apiKey: apiKeyOption, + /** * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. */ diff --git a/packages/client-query-suggestions/src/querySuggestionsClient.ts b/packages/client-query-suggestions/src/querySuggestionsClient.ts index 93f79088a..ed3f2c7f0 100644 --- a/packages/client-query-suggestions/src/querySuggestionsClient.ts +++ b/packages/client-query-suggestions/src/querySuggestionsClient.ts @@ -78,6 +78,11 @@ export function createQuerySuggestionsClient({ */ appId: appIdOption, + /** + * The `apiKey` currently in use. + */ + apiKey: apiKeyOption, + /** * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. */ diff --git a/packages/client-search/src/searchClient.ts b/packages/client-search/src/searchClient.ts index 85474989c..e25494c56 100644 --- a/packages/client-search/src/searchClient.ts +++ b/packages/client-search/src/searchClient.ts @@ -214,6 +214,11 @@ export function createSearchClient({ */ appId: appIdOption, + /** + * The `apiKey` currently in use. + */ + apiKey: apiKeyOption, + /** * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. */ diff --git a/packages/ingestion/src/ingestionClient.ts b/packages/ingestion/src/ingestionClient.ts index cbf478a66..5b6633241 100644 --- a/packages/ingestion/src/ingestionClient.ts +++ b/packages/ingestion/src/ingestionClient.ts @@ -196,6 +196,11 @@ export function createIngestionClient({ */ appId: appIdOption, + /** + * The `apiKey` currently in use. + */ + apiKey: apiKeyOption, + /** * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. */ diff --git a/packages/monitoring/src/monitoringClient.ts b/packages/monitoring/src/monitoringClient.ts index 3bc73f9bb..ce28e2889 100644 --- a/packages/monitoring/src/monitoringClient.ts +++ b/packages/monitoring/src/monitoringClient.ts @@ -72,6 +72,11 @@ export function createMonitoringClient({ */ appId: appIdOption, + /** + * The `apiKey` currently in use. + */ + apiKey: apiKeyOption, + /** * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. */ diff --git a/packages/recommend/src/recommendClient.ts b/packages/recommend/src/recommendClient.ts index d7fcce474..4d6e7c427 100644 --- a/packages/recommend/src/recommendClient.ts +++ b/packages/recommend/src/recommendClient.ts @@ -106,6 +106,11 @@ export function createRecommendClient({ */ appId: appIdOption, + /** + * The `apiKey` currently in use. + */ + apiKey: apiKeyOption, + /** * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties. */