Skip to content
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(metadata): register metadata around middleware #5491

Closed
wants to merge 10 commits into from

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Feb 21, 2023

Summary

Since $$type and $$internal are added in #5488, we can use this to give some information around middleware in metadata

Result

A new key in metadata is available, with a shape like this:

{
  "middleware": [{ "type": "ais.insights", "internal": false }]
}

We don't know the parameters passed by the users, as it's defaulted early on in the arguments and there's no equivalent to getWidgetRenderState().widgetParams

This is the same as #5492, but in a new middleware key, requiring some changes to the output data

To better prepare for the insights middleware being automatically added, we are making the following changes:

- useCookie by default true so userToken does not need to be provided
- still call `insightsClient` if no userToken is found (userToken can be applied using useCookie, thus not known)
- error on unknown algolia credentials converted to warning
the insights middleware is added now for downstream
We don't know the parameters passed by the users, as it's defaulted early on in the arguments and there's no equivalent to getWidgetRenderState().widgetParams
@codesandbox-ci
Copy link

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 d7d1e1c:

Sandbox Source
InstantSearch.js Configuration
react-instantsearch-app Configuration
example-react-instantsearch-hooks-default-theme Configuration
example-vue-instantsearch-default-theme Configuration

@Haroenv Haroenv force-pushed the feat/automatic-insights-middleware branch from 5b35140 to 3d7aa28 Compare February 21, 2023 14:25
Base automatically changed from feat/automatic-insights-middleware to feat/automatic-insights February 23, 2023 10:56
@Haroenv Haroenv closed this Feb 27, 2023
@Haroenv Haroenv deleted the feat/telemetry-middleware branch February 15, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant