-
Notifications
You must be signed in to change notification settings - Fork 332
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
feat(preset-algolia): attach algolia credentials on hits #1117
feat(preset-algolia): attach algolia credentials on hits #1117
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 1296bc9:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this works I think, naming could be edited possibly
packages/autocomplete-plugin-algolia-insights/src/types/AlgoliaInsightsHit.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Haroen Viaene <[email protected]>
Co-authored-by: Haroen Viaene <[email protected]>
Co-authored-by: Haroen Viaene <[email protected]>
Co-authored-by: Haroen Viaene <[email protected]>
Co-authored-by: Haroen Viaene <[email protected]>
Co-authored-by: Haroen Viaene <[email protected]>
Co-authored-by: Haroen Viaene <[email protected]>
export function getAppIdAndApiKey( | ||
searchClient: SearchClient | ||
): { appId: string; apiKey: string } { | ||
const { headers, queryParameters } = searchClient.transporter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dhayab, I am not sure if we are using autocomplete incorrectly, but we ran into an issue where the transporter
wasn't checked and the JS code was trying to pull headers from undefined
. Could you help with this? We have a fix in a place where we are using version 1.8.3 of autocomplete-preset-algolia
. We could be using it wrong, I am not sure.
https://github.com/algolia/algoliasearch-shopify/pull/1520
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Bryan, this is probably because you have the v3 of algoliasearch
in your dependencies. Autocomplete relies on the v4, which is what causes the issue right now.
If you're not using the javascript search client directly, you can safely update it to the latest v4 version as InstantSearch and Autocomplete have support for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh wonderful thank you!
This PR adds an
__autocomplete_algoliaResultsMetadata
property on each hit returned from an Algolia source, that includes the credentials of the application it comes from. This will help us send events to the appropriate location at a later stage.FX-2276