Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(javascript): expose current apiKey on the client instance [skip-bc] #4285

Merged
merged 3 commits into from
Dec 24, 2024

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Dec 24, 2024

🧭 What and Why

Expose the currently used api key. This is good for instantiating other information (like insights client) and is consistent with the appId being exposed.

Changes included:

  • add apiKey to the client template

🧪 Test

const appId = "appId";
const apiKey = "apiKey";

const client = algoliasearch(appId, apiKey) // and other clients

expect(client.appId).toBe(appId)
expect(client.apiKey).toBe(apiKey)

This is good for instantiating other information (like insights client) and is consistent with the appId being exposed.
@Haroenv Haroenv requested a review from a team as a code owner December 24, 2024 12:30
@Haroenv Haroenv requested review from millotp and shortcuts December 24, 2024 12:30
@algolia-bot
Copy link
Collaborator

algolia-bot commented Dec 24, 2024

✔️ Code generated!

Name Link
🪓 Triggered by c403f1e62e10850cfeef4fa6c659efa89da9d4b7
🍃 Generated commit 82471e7112277da52f6fc812529959b5f1a386f7
🌲 Generated branch generated/feat/clients-expose-api-key
📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
javascript 1676

@shortcuts shortcuts changed the title feat(js): expose current apiKey on the client instance feat(javascript): expose current apiKey on the client instance [skip-bc] Dec 24, 2024
shortcuts
shortcuts previously approved these changes Dec 24, 2024
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice ty!!

Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

20/20

@shortcuts shortcuts enabled auto-merge (squash) December 24, 2024 12:43
@shortcuts shortcuts merged commit e972f9b into main Dec 24, 2024
12 checks passed
@shortcuts shortcuts deleted the feat/clients-expose-api-key branch December 24, 2024 12:54
algolia-bot added a commit that referenced this pull request Dec 24, 2024
…bc] (#4285) (generated) [skip ci]

Co-authored-by: Haroen Viaene <hello@haroen.me>
algolia-bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request Dec 24, 2024
…bc] (generated)

algolia/api-clients-automation#4285

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Haroen Viaene <hello@haroen.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants