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

Add parameter to use a secured API key instead of the global api key in the config #207

Open
Splinteer opened this issue Sep 4, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Splinteer
Copy link

Is your feature request related to a problem? Please describe.

I have user restricted data in my indexes but the only way to access it is using a secured API key.
But actually the searchClient is created via useAlgoliaRef() that use the global search key.

Describe the solution you'd like

I need a way to pass the apiKey to the useAlgoliaRef() composable

@Splinteer Splinteer added the enhancement New feature or request label Sep 4, 2024
@Baroshem
Copy link
Collaborator

Baroshem commented Sep 9, 2024

Hey there,

What about passing index as a parameter for useAlgoliaSearch composable? https://algolia.nuxtjs.org/getting-started/usage#usealgoliasearch

The one passed in the composable should be applied before the global one

@Splinteer
Copy link
Author

Because the index doesn't change, and if you want user restricted data you must use a different api key.
Cf: https://www.algolia.com/doc/guides/security/api-keys/how-to/user-restricted-access-to-data

@Baroshem
Copy link
Collaborator

Ahh I see, makes sense.

Would you be interested in contributing to the module with this change? I can provide the help if needed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants