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

Error with search.js (v1.1.0): 'Client ID is invalid' #22

Open
allforcode opened this issue May 3, 2024 · 2 comments
Open

Error with search.js (v1.1.0): 'Client ID is invalid' #22

allforcode opened this issue May 3, 2024 · 2 comments

Comments

@allforcode
Copy link

Actual Behaviour

I followed the instructions provided in the README to build search.js version 1.1.0 for a Magento website. However, when I integrated the file into the website, I encountered an error stating 'Client ID is invalid.' from the request https://catalog-service-sandbox.adobe.io/graphql

Interestingly, I noticed that there is no issue when using the version v1.0.4, which comes from the URL https://plp-widgets-ui.magento-ds.com/v1/search.js.

Could there be issues in v1.1.0 that are not present in v1.0.4?

Expected Behaviour

Search.js should function without errors and provide the expected search functionality on the website.

Steps to Reproduce

  1. Build search.js by running npm run build.
  2. Integrate search.js into a website, which is Magento in my case.
  3. The search result page is blank and the endpoint https://catalog-service-sandbox.adobe.io/graphql returns an error message 'Client ID is invalid'.
{
    "error": {
        "code": "Forbidden",
        "message": "Client ID is invalid",
        "details": {
            "error_code": "403003"
        }
    }
}

Platform and Version

Adobe Magento Commerce ver. 2.4.7

@MichaelHeinzman
Copy link

MichaelHeinzman commented May 3, 2024

I'm not sure if this will be helpful but when I forked the project and tried to use search.js, I had to change the following line in store.tsx. They changed this in the recent version. I'm not sure if I got the same error you did, but that was the only issue I had about two months ago.

environmentType?.toLowerCase() === 'testing' && !apiKey ? SANDBOX_KEY : apiKey

to

environmentType?.toLowerCase() === 'testing' ? SANDBOX_KEY : apiKey

@allforcode
Copy link
Author

Thank you for your help and solution! Your advice was very useful. With the change, I managed to fix my problem. I really appreciate your expertise. Thanks again!

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

No branches or pull requests

2 participants