Elastic API consumption at Client Side (Browser) using JavaScript

Just curious to know if there we can consume ES API (only GET Http Requests) on client side i.e. browser using JavaScript of the browser (note: not Server Side JavaScript i.e. Nodejs).

Is server, as the client, the only way to consume ES API?

Please guide!

Not sure I understood the question. Are you looking for a js client for elasticsearch?

@dadoonet I already know about https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/introduction.html (which is for Nodejs JavaScript) but I am asking for ES API JS SDK to use at Frontend React JS.


I've got the same question.

In front-end, what should we use to consume an elastic search server?

The official JS Client is only for node.js.

We certainly could consume it via fetch/axios as classic REST API, but it misses a lot of sugar methods to consume easier the server.

Not exactly the answer you are looking for but here is an interesting link IMO for people building their own UI on top of Site Search or App Search: https://swiftype.com/search-ui

Note that App Search is in beta: https://www.elastic.co/downloads/app-search

I've seen some similar components on the web working on top of elasticsearch. A google search might gives you some results.

For the moment, I use Searchkit and ReactiveSearch, but I wanted to build my own queries, but with some sugar/with a client, not directly the whole payload on a raw http query.

Thank you, I'll have a look to Search UI.

I was also looking to know if we can consume The API on the client side, with Angular 8 HttpClient and working with Observable, and of course an official lib of the elastic ...