Skip to content

Commit

Permalink
feat(javascript): expose current apiKey on the client instance [skip-…
Browse files Browse the repository at this point in the history
…bc] (#4285)
  • Loading branch information
Haroenv authored Dec 24, 2024
1 parent a57612a commit e972f9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
7 changes: 6 additions & 1 deletion templates/javascript/clients/api-single.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ export function create{{#lambda.titlecase}}{{clientName}}{{/lambda.titlecase}}({
*/
appId: appIdOption,
/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,
/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
Expand Down Expand Up @@ -177,4 +182,4 @@ export function create{{#lambda.titlecase}}{{clientName}}{{/lambda.titlecase}}({
};
}

{{/operations}}
{{/operations}}

0 comments on commit e972f9b

Please sign in to comment.