Invalid Application-ID or API key with Secure API Key, cant see whats wrong

How I generate the token in back-end :

const algoliaClientSearch = algoliasearch(APP_ID, SEARCH_ONLY);
const KEY = algoliaClientSearch.generateSecuredApiKey(SEARCH_ONLY , {  userToken: decoded.uid })

Then I init the front-end client :
let client = algoliasearch(APP_ID, KEY )

The search :

indexRef = this.client.initIndex(index)

The Error :

Invalid Application-ID or API key secure

If I use my search-only key directly on front end, it works.

Thank you

Hi @btry, This looks like it should work assuming you are using the correct APP_ID and Search API Key. Could you write in to and provide your app id, so we can help troubleshoot?