You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGES.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
2.6.0 (October XX, 2025)
2
+
- Added `useTreatment`, `useTreatments`, `useTreatmentWithConfig` and `useTreatmentsWithConfig` hooks to replace the now deprecated `useSplitTreatments` hook.
2
3
- Updated @splitsoftware/splitio package to version 11.7.1 that includes minor updates:
3
4
- Added support for custom loggers: added `logger` configuration option and `factory.Logger.setLogger` method to allow the SDK to use a custom logger.
4
5
5
-
6
6
2.5.0 (September 18, 2025)
7
7
- Updated @splitsoftware/splitio package to version 11.6.0 that includes minor updates:
8
8
- Added `storage.wrapper` configuration option to allow the SDK to use a custom storage wrapper for the storage type `LOCALSTORAGE`. Default value is `window.localStorage`.
* An object of type Attributes used to evaluate the feature flags.
189
+
*/
190
+
attributes?: SplitIO.Attributes;
191
+
}
192
+
193
+
/**
194
+
* @deprecated `useSplitTreatments` will be removed in a future major release. We recommend replacing it with the `useTreatment*` hooks.
195
+
*/
182
196
exporttypeGetTreatmentsOptions=({
183
197
184
198
/**
@@ -193,27 +207,51 @@ export type GetTreatmentsOptions = ({
193
207
*/
194
208
flagSets: string[];
195
209
names?: undefined;
196
-
})&{
210
+
})&EvaluationOptions;
197
211
198
-
/**
199
-
* An object of type Attributes used to evaluate the feature flags.
200
-
*/
201
-
attributes?: SplitIO.Attributes;
212
+
/**
213
+
* Options object accepted by the `useSplitTreatments` hook, used to call `client.getTreatmentsWithConfig()`, or `client.getTreatmentsWithConfigByFlagSets()`,
214
+
* depending on whether `names` or `flagSets` options are provided, and to retrieve the result along with the Split context.
215
+
*
216
+
* @deprecated `useSplitTreatments` will be removed in a future major release. We recommend replacing it with the `useTreatment*` hooks.
* Options object accepted by the `useTreatment` and `useTreatmentWithConfig` hooks.
222
+
*/
223
+
exporttypeIUseTreatmentOptions={
202
224
203
225
/**
204
-
* Optional properties to append to the generated impression object sent to Split backend.
226
+
* Feature flag name to evaluate.
205
227
*/
206
-
properties?: SplitIO.Properties;
207
-
}
228
+
name: string;
229
+
}&EvaluationOptions&IUseSplitClientOptions;
230
+
208
231
209
232
/**
210
-
* Options object accepted by the `useSplitTreatments` hook, used to call `client.getTreatmentsWithConfig()`, or `client.getTreatmentsWithConfigByFlagSets()`,
211
-
* depending on whether `names` or `flagSets` options are provided, and to retrieve the result along with the Split context.
233
+
* Options object accepted by the `useTreatments` and `useTreatmentsWithConfig` hooks.
* List of feature flag names to evaluate. Either this or the `flagSets` property must be provided. If both are provided, the `flagSets` option is ignored.
239
+
*/
240
+
names: string[];
241
+
flagSets?: undefined;
242
+
}|{
243
+
244
+
/**
245
+
* List of feature flag sets to evaluate. Either this or the `names` property must be provided. If both are provided, the `flagSets` option is ignored.
246
+
*/
247
+
flagSets: string[];
248
+
names?: undefined;
249
+
})&EvaluationOptions&IUseSplitClientOptions;
214
250
215
251
/**
216
252
* SplitTreatments Child Props interface. These are the props that the child component receives from the 'SplitTreatments' component.
253
+
*
254
+
* @deprecated `SplitTreatments` will be removed in a future major release. We recommend replacing it with the `useTreatments*` hooks.
* An object with the treatments with configs for a bulk of feature flags, returned by client.getTreatmentsWithConfig() or client.getTreatmentsWithConfigByFlagSets().
317
+
* Each existing configuration is a stringified version of the JSON you defined on the Split user interface. For example:
* SplitTreatments Props interface. These are the props accepted by SplitTreatments component, used to call 'client.getTreatmentsWithConfig()', or 'client.getTreatmentsWithConfigByFlagSets()',
236
331
* depending on whether `names` or `flagSets` props are provided, and to pass the result to the child component.
332
+
*
333
+
* @deprecated `SplitTreatments` will be removed in a future major release. We recommend replacing it with the `useTreatments*` hooks.
* `useSplitTreatments` is a hook that returns an Split Context object extended with a `treatments` property object that contains feature flag evaluations.
@@ -17,20 +15,9 @@ import { useSplitClient } from './useSplitClient';
* `useTreatment` is a hook that returns an Split Context object extended with a `treatment` property.
8
+
* It uses the `useSplitClient` hook to access the client, and invokes the `client.getTreatment()` method.
9
+
*
10
+
* @param options - An options object with a feature flag name to evaluate, and an optional `attributes` and `splitKey` values to configure the client.
11
+
* @returns A Split Context object extended with a Treatment instance, that might be a control treatment if the client is not available or ready, or if the provided feature flag name does not exist.
* `useTreatmentWithConfig` is a hook that returns an Split Context object extended with a `treatment` property.
8
+
* It uses the `useSplitClient` hook to access the client, and invokes the `client.getTreatmentWithConfig()` method.
9
+
*
10
+
* @param options - An options object with a feature flag name to evaluate, and an optional `attributes` and `splitKey` values to configure the client.
11
+
* @returns A Split Context object extended with a TreatmentWithConfig instance, that might be a control treatment if the client is not available or ready, or if the provided feature flag name does not exist.
* `useTreatments` is a hook that returns an Split Context object extended with a `treatments` property object that contains feature flag evaluations.
8
+
* It uses the `useSplitClient` hook to access the client, and invokes the `client.getTreatments()` method if the `names` option is provided,
9
+
* or the `client.getTreatmentsByFlagSets()` method if the `flagSets` option is provided.
10
+
*
11
+
* @param options - An options object with a list of feature flag names or flag sets to evaluate, and an optional `attributes` and `splitKey` values to configure the client.
12
+
* @returns A Split Context object extended with a Treatments instance, that might contain control treatments if the client is not available or ready, or if feature flag names do not exist.
0 commit comments