Javascript Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at https://www.flagsmith.com/
This version includes an npm audit fix.
This release adds an integration to Datadog RUM, it focuses on the new experimental feature_flags feature, you can read more about it here https://docs.datadoghq.com/real_user_monitoring/guide/setup-feature-flag-data-collection/?tab=npm.
This will track remote config and feature enabled states as feature flags in the following format
flagsmith_value_<FEATURE_NAME> // remote config
flagsmith_enabled_<FEATURE_NAME> // enabled state
Additionally, the integration will also store Flagsmith traits against the Datadog user in the following format:
flagsmith_trait_<FEATURE_NAME> // remote config
You can find an example of this integration here.
This release adds a stable implementation of realtime features and is used on app.flagsmith.com.
Flagsmith projects that are opted into realtime are able to enable realtime within flagsmith.init as {realtime: true}
, this will instruct the SDK to connect to our realtime SSE endpoint to receive feature updates from the environment and segment overrides.
Closes https://github.com/Flagsmith/flagsmith-js-client/issues/93. This aims to make the type of onError more predictable by always sending it as an Error object. Thank you to @gfrancischini for the sensible suggestion!
Prior to this release, setTrait(s) calls were not returning a promise, they will now resolve when the API returns a new set of flags.
flagsmith.setTrait("trait",null)
. Also, this prevents an issue where segment flags were sometimes not returned in response to setting a trait.Prior to this release, there were cases where flags provided by serverState are cleared, potentially effecting the isomorphic client (e.g. Next.js applications). This is because <ReactProvider/>
initialises Flagsmith internally after server state is set.
This change makes sure that Flagsmith is initialises with the server state so that the state is preserved.
This release reduces the bundle size (31kb -> 21kb Pre GZIP) of the core SDK, it does so by patching one of our only dependencies (@callstack/async-storage) to export just the functions we need and remove the dependency of lodash.