algolia / algoliasearch-helper-js

Helper for implementing advanced search features with Algolia
https://instantsearchjs.netlify.app/algoliasearch-helper-js/
MIT License
174 stars 46 forks source link

Usage on Backend #942

Closed awais019 closed 1 year ago

awais019 commented 1 year ago

I'm trying to implement algolia search on backend but when I call on the result event, the callback is fired asynchronously and the response is returned before the results are set. How can I use it on the backend? If it can't be used then how can I implement security on the front end? API key and application id are exposed during network requests.

dhayab commented 1 year ago

You can listen to the result event to make sure results are received from Algolia.

Note that the search-only API key is safe to use in frontend environments. If you need it, you can set up additional restrictions on HTTP referrers or other characteristics: https://www.algolia.com/doc/guides/security/api-keys/#rights-and-restrictions.