-
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(insights): set algolia credentials per event when supported #1120
feat(insights): set algolia credentials per event when supported #1120
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 0650ea1:
|
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.
All object-based event methods are updated to accept items
instead of objectIDs
, from which we can retrieve the relevant Algolia credentials to craft the additional parameters that are then sent with the event payload.
Facet/filter-based event methods are not touched, as we don't have a use for them in the context of Autocomplete.
bd24f5f
to
1b133b9
Compare
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.
Looks good to me, nice work! 👏
packages/autocomplete-plugin-algolia-insights/src/__tests__/createSearchInsightsApi.ts.test.ts
Outdated
Show resolved
Hide resolved
packages/autocomplete-plugin-algolia-insights/src/createSearchInsightsApi.ts
Outdated
Show resolved
Hide resolved
packages/autocomplete-plugin-algolia-insights/src/createSearchInsightsApi.ts
Outdated
Show resolved
Hide resolved
packages/autocomplete-plugin-algolia-insights/src/createSearchInsightsApi.ts
Show resolved
Hide resolved
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.
Can you highlight what changed? Since there was a file rename the diff shows everything as new.
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.
Sure, this should give you the changes before the file rename: e446d48#diff-9d876eb2a027f19903ce6ce0aa98bca3222a13857a61eb1751dfd11eda392552.
packages/autocomplete-plugin-algolia-insights/src/__tests__/createAlgoliaInsightsPlugin.test.ts
Outdated
Show resolved
Hide resolved
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.
seems logical, let's go!
This PR sends events with additional parameters containing Algolia credentials, when the Insights client supports it.
Now, when the Insights client version supports it, we send events with an additional parameter that contain Algolia credentials relevant to the items. This makes it possible to have different Algolia sources that each send events to their corresponding Insights endpoints.
All relevant methods of the Insights API we provide (on top of the Insights client) are updated to require an
items
property in their payload, instead of the now deprecatedobjectIDs
property.FX-2277