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
When using the createInsightsMiddleware with the typesense-instantsearch-adapter search client, the useInstantSearch from 'react-instantsearch-hooks' throws the following error:
Uncaught Error: [insights middleware]: could not extract Algolia credentials from searchClient
This appears to be because of a missing appId and appKey. Attempts to add this via search-insights have not been successful:
import aa from 'search-insights';
aa('init', { appId: 'test', appKey: 'test'})
What I'm trying to achieve is to use insights to send events to a third-party analytics service.
@tomzweb I recently encountered this issue myself when developing a Search page for a client. It turns out that the reason for this, in my case, was that I was attempting to remove empty queries from Search Analytics using the old React InstantSearch method.
Specifically, look at the React Hooks example and note that the searchClient constant now has ...algoliaClient as part of it. This cleared up the issue and it's now working for me.
Description
When using the
createInsightsMiddleware
with the typesense-instantsearch-adapter search client, theuseInstantSearch
from 'react-instantsearch-hooks' throws the following error:Uncaught Error: [insights middleware]: could not extract Algolia credentials from searchClient
This appears to be because of a missing appId and appKey. Attempts to add this via search-insights have not been successful:
What I'm trying to achieve is to use insights to send events to a third-party analytics service.
Steps to reproduce
Create an insights middleware component:
Provide the InsightsMiddleware to the InstantSearch component:
Expected Behavior
The ability to use insights middleware to send events to third-party APIs.
Actual Behavior
Uncaught Error: [insights middleware]: could not extract Algolia credentials from searchClient
The text was updated successfully, but these errors were encountered: