Skip to content

Commit 3df88c8

Browse files
algolia-botHaroenv
andcommitted
feat(javascript): expose current apiKey on the client instance [skip-bc] (generated)
algolia/api-clients-automation#4285 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Haroen Viaene <[email protected]>
1 parent c8a275c commit 3df88c8

File tree

12 files changed

+59
-0
lines changed

12 files changed

+59
-0
lines changed

Diff for: packages/algoliasearch/__tests__/algoliasearch.common.test.ts

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ describe('api', () => {
2020
expect(client.appId).toEqual('APP_ID');
2121
});
2222

23+
test('exposes the `apiKey` currently in use at the root of the API', () => {
24+
expect(client.apiKey).toEqual('API_KEY');
25+
});
26+
2327
test('provides a `clearCache` method', () => {
2428
expect(client.clearCache).not.toBeUndefined();
2529
expect(() => client.clearCache()).not.toThrow();

Diff for: packages/algoliasearch/lite/src/liteClient.ts

+5
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ export function createLiteClient({
9696
*/
9797
appId: appIdOption,
9898

99+
/**
100+
* The `apiKey` currently in use.
101+
*/
102+
apiKey: apiKeyOption,
103+
99104
/**
100105
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
101106
*/

Diff for: packages/client-abtesting/src/abtestingClient.ts

+5
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ export function createAbtestingClient({
7979
*/
8080
appId: appIdOption,
8181

82+
/**
83+
* The `apiKey` currently in use.
84+
*/
85+
apiKey: apiKeyOption,
86+
8287
/**
8388
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
8489
*/

Diff for: packages/client-analytics/src/analyticsClient.ts

+5
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ export function createAnalyticsClient({
106106
*/
107107
appId: appIdOption,
108108

109+
/**
110+
* The `apiKey` currently in use.
111+
*/
112+
apiKey: apiKeyOption,
113+
109114
/**
110115
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
111116
*/

Diff for: packages/client-composition/src/compositionClient.ts

+5
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ export function createCompositionClient({
113113
*/
114114
appId: appIdOption,
115115

116+
/**
117+
* The `apiKey` currently in use.
118+
*/
119+
apiKey: apiKeyOption,
120+
116121
/**
117122
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
118123
*/

Diff for: packages/client-insights/src/insightsClient.ts

+5
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ export function createInsightsClient({
6969
*/
7070
appId: appIdOption,
7171

72+
/**
73+
* The `apiKey` currently in use.
74+
*/
75+
apiKey: apiKeyOption,
76+
7277
/**
7378
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
7479
*/

Diff for: packages/client-personalization/src/personalizationClient.ts

+5
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ export function createPersonalizationClient({
7373
*/
7474
appId: appIdOption,
7575

76+
/**
77+
* The `apiKey` currently in use.
78+
*/
79+
apiKey: apiKeyOption,
80+
7681
/**
7782
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
7883
*/

Diff for: packages/client-query-suggestions/src/querySuggestionsClient.ts

+5
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ export function createQuerySuggestionsClient({
7878
*/
7979
appId: appIdOption,
8080

81+
/**
82+
* The `apiKey` currently in use.
83+
*/
84+
apiKey: apiKeyOption,
85+
8186
/**
8287
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
8388
*/

Diff for: packages/client-search/src/searchClient.ts

+5
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ export function createSearchClient({
214214
*/
215215
appId: appIdOption,
216216

217+
/**
218+
* The `apiKey` currently in use.
219+
*/
220+
apiKey: apiKeyOption,
221+
217222
/**
218223
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
219224
*/

Diff for: packages/ingestion/src/ingestionClient.ts

+5
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ export function createIngestionClient({
196196
*/
197197
appId: appIdOption,
198198

199+
/**
200+
* The `apiKey` currently in use.
201+
*/
202+
apiKey: apiKeyOption,
203+
199204
/**
200205
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
201206
*/

Diff for: packages/monitoring/src/monitoringClient.ts

+5
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ export function createMonitoringClient({
7272
*/
7373
appId: appIdOption,
7474

75+
/**
76+
* The `apiKey` currently in use.
77+
*/
78+
apiKey: apiKeyOption,
79+
7580
/**
7681
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
7782
*/

Diff for: packages/recommend/src/recommendClient.ts

+5
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ export function createRecommendClient({
106106
*/
107107
appId: appIdOption,
108108

109+
/**
110+
* The `apiKey` currently in use.
111+
*/
112+
apiKey: apiKeyOption,
113+
109114
/**
110115
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
111116
*/

0 commit comments

Comments
 (0)