Invalid credentials

I am using the right credentials.
My instance is deployed in ""
I just need to access the information I installed to enterprise-search from elastic on my machine, from localhost. Do you think this may be a problem like a router port, cors, or firewall? I think this should just work as per the docs.

const { Client } = require('@elastic/enterprise-search');

const client = new Client({
url: '[](https://my-deployment-',
auth: {
token: 'private-6khjfgd2ft9s72vsj7kqtd3ygz'

ResponseError: {"error":"unable_to_authenticate_user"}

p.s. thise credentials are not real, but close enough to state the point that they look like the real ones, but when I try to use the real ones from the elastic AWS UI they return the same responseError. Any idea why this might not be working?

hi @Jorge_Nunes

How are you performing the request? Is it through the browser or through a node app?
Looks like you are using the API key correctly so might be something else.

The @elastic/enterprise-search package is only designed for node apps for making server side API calls to Enterprise search. If you're using the browser, you should look into @elastic/app-search-javascript - npm

Hope this helps!

Hi @joemcelroy

I am using the Node.js version from the following repository:

$ node -v

I was able to log in with a user and a password instead.


  • Jorge

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.