Releases: Flagsmith/flagsmith-js-client
3.18.2 - Adds Datadog RUM
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.
3.18.1 - Realtime features
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.
3.16.0 - Always send an Error object to onError
Closes #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!
3.15.1 - Fix Promise return from setTrait(s)
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.
3.15.0 - Unify and improve setTrait / setTraits calls
- Calls to setTrait/setTraits now only hit 1 endpoint, previously they hit 2.
- The behaviour of setTrait now matches setTraits, prior to this you could not delete a trait via
flagsmith.setTrait("trait",null)
. Also, this prevents an issue where segment flags were sometimes not returned in response to setting a trait.
3.14.1 - React fix: initialise flagsmith with serverState if provided
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.
3.14.0 - Reduce bundle size
3.13.1 - fix IFlagsmithFeature type
3.13.0 - Fix race condition with useFlags
Prior to this release, there were cases where useFlags was not updating flags when the Flagsmith cache was received. This was down to event listeners not being initialised prior to the cache being accessed.
3.12.0 - fix fallback usage on null flags
A few releases ago we added the ability to automatically parse JSON in flagsmith.getValue. Since null is parseable by JSON.parse, the fallback was not being used in a lot of cases. Now, the client will ignore null flag values and use the fallback.
const json = flagsmith.getValue<{foo: string|null, bar: string|null}>("json_value", {
json: true,
fallback: {foo:null,bar:null}
});
// if the value is null, json before this release would be null