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
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
2.8.0 (October 28, 2025)
2
2
- Added new configuration for Fallback Treatments, which allows setting a treatment value and optional config to be returned in place of "control", either globally or by flag. Read more in our docs.
3
+
- Added `client.getStatus()` method to retrieve the client readiness status properties (`isReady`, `isReadyFromCache`, etc).
3
4
- Added `client.whenReady()` and `client.whenReadyFromCache()` methods to replace the deprecated `client.ready()` method, which has an issue causing the returned promise to hang when using async/await syntax if it was rejected.
4
5
- Updated the SDK_READY_FROM_CACHE event to be emitted alongside the SDK_READY event if it hasn’t already been emitted.
Copy file name to clipboardExpand all lines: types/splitio.d.ts
+52Lines changed: 52 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -695,6 +695,52 @@ declare namespace SplitIO {
695
695
[statusinConsentStatus]: ConsentStatus;
696
696
};
697
697
}
698
+
/**
699
+
* Readiness Status interface. It represents the readiness state of an SDK client.
700
+
*/
701
+
interfaceReadinessStatus{
702
+
703
+
/**
704
+
* `isReady` indicates if the client has triggered an `SDK_READY` event and
705
+
* thus is ready to evaluate with cached data synchronized with the backend.
706
+
*/
707
+
isReady: boolean;
708
+
709
+
/**
710
+
* `isReadyFromCache` indicates if the client has triggered an `SDK_READY_FROM_CACHE` event and
711
+
* thus is ready to evaluate with cached data, although the data in cache might be stale, not synchronized with the backend.
712
+
*/
713
+
isReadyFromCache: boolean;
714
+
715
+
/**
716
+
* `isTimedout` indicates if the client has triggered an `SDK_READY_TIMED_OUT` event and is not ready to evaluate.
717
+
* In other words, `isTimedout` is equivalent to `hasTimedout && !isReady`.
718
+
*/
719
+
isTimedout: boolean;
720
+
721
+
/**
722
+
* `hasTimedout` indicates if the client has ever triggered an `SDK_READY_TIMED_OUT` event.
723
+
* It's meant to keep a reference that the SDK emitted a timeout at some point, not the current state.
724
+
*/
725
+
hasTimedout: boolean;
726
+
727
+
/**
728
+
* `isDestroyed` indicates if the client has been destroyed, i.e., `destroy` method has been called.
729
+
*/
730
+
isDestroyed: boolean;
731
+
732
+
/**
733
+
* `isOperational` indicates if the client can evaluate feature flags.
734
+
* In this state, `getTreatment` calls will not return `CONTROL` due to the SDK being unready or destroyed.
735
+
* It's equivalent to `isReadyFromCache && !isDestroyed`.
736
+
*/
737
+
isOperational: boolean;
738
+
739
+
/**
740
+
* `lastUpdate` indicates the timestamp of the most recent status event.
741
+
*/
742
+
lastUpdate: number;
743
+
}
698
744
/**
699
745
* Common API for entities that expose status handlers.
700
746
*/
@@ -703,6 +749,12 @@ declare namespace SplitIO {
703
749
* Constant object containing the SDK events for you to use.
704
750
*/
705
751
Event: EventConsts;
752
+
/**
753
+
* Gets the readiness status.
754
+
*
755
+
* @returns The current readiness status.
756
+
*/
757
+
getStatus(): ReadinessStatus;
706
758
/**
707
759
* Returns a promise that resolves when the SDK has finished initial synchronization with the backend (`SDK_READY` event emitted), or rejected if the SDK has timedout (`SDK_READY_TIMED_OUT` event emitted).
708
760
* As it's meant to provide similar flexibility to the event approach, given that the SDK might be eventually ready after a timeout event, the `ready` method will return a resolved promise once the SDK is ready.
0 commit comments