You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The type SearchClientNodeHelpers does not seem to be used in the searchclient typing.
As a result, the generateSecuredApiKey method and others are not available in the client typing.
on a fresh repository with node 24.15.0, my algoliasearch imports node_modules/algoliasearch/dist/node.d.ts typed Algoliasearch which is a union of SearchClient imported from node_modules/@algolia/client-search/dist/node.d.ts that resolves to the line I've sent above
My repository uses node 24 and has the dependency "algoliasearch": "5.55.0".
It is a basic node project for cloud functions.
When i open the type definition with vs-code ( node_modules/algoliasearch/dist/browser.d.ts ) i can see that it looks like this:
This was the information I was looking for! This way we can try to see if the module resolution is appropriate for your runner, here it seems to resolve the browser bundle which I guess isn't correct, I don't know much about cloud functions so we would need to investigate, but I believe it should be similar to the cloudflare workers cc @Fluf22
Thank you very much, that was the issue. I had the tsconfig not correctly setup.
Changing from "module": "commonjs" to "module": "Node16" and "moduleResolution": "node16" fixed it and types are working correctly now for algolia.
Activity
shortcuts commentedon Jun 23, 2026
Hey, could you please provide some details about the environment are you running the client on?
The client exposes builds for different env (browser, node, workers, etc.), and looking at the node bundler chain, it should already provide that type union exposed here https://github.com/algolia/api-clients-automation/blob/d33878eea6915a492e6709e4ebdc52ce4cb458d0/clients/algoliasearch-client-javascript/packages/client-search/builds/node.ts#L3
on a fresh repository with node 24.15.0, my
algoliasearchimportsnode_modules/algoliasearch/dist/node.d.tstypedAlgoliasearchwhich is a union ofSearchClientimported fromnode_modules/@algolia/client-search/dist/node.d.tsthat resolves to the line I've sent aboveI'm wondering if yours doesn't resolve to the browser build, which doesn't union the node helpers type https://github.com/algolia/api-clients-automation/blob/d33878eea6915a492e6709e4ebdc52ce4cb458d0/clients/algoliasearch-client-javascript/packages/client-search/builds/browser.ts#L51
Rolleander commentedon Jun 23, 2026
What details should i look up exactly?
My repository uses node 24 and has the dependency "algoliasearch": "5.55.0".
It is a basic node project for cloud functions.
When i open the type definition with vs-code ( node_modules/algoliasearch/dist/browser.d.ts ) i can see that it looks like this:
shortcuts commentedon Jun 23, 2026
Thanks for your answer
This was the information I was looking for! This way we can try to see if the module resolution is appropriate for your runner, here it seems to resolve the browser bundle which I guess isn't correct, I don't know much about cloud functions so we would need to investigate, but I believe it should be similar to the cloudflare workers cc @Fluf22
shortcuts commentedon Jun 23, 2026
Just a hint in case that's as easy as that but make sure your module resolution is set to node, something like https://github.com/getsentry/cloud-run-typescript-template/blob/main/tsconfig.json#L6
Rolleander commentedon Jun 23, 2026
Thank you very much, that was the issue. I had the tsconfig not correctly setup.
Changing from "module": "commonjs" to "module": "Node16" and "moduleResolution": "node16" fixed it and types are working correctly now for algolia.
shortcuts commentedon Jun 23, 2026
Let's goooooooo enjoy