File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,26 +174,6 @@ by down-stream clients, like the React SDK.
174174Note that accessing ` isEnabled ` on the object returned by ` getFeatures ` does not automatically
175175generate a ` check ` event, contrary to the ` isEnabled ` property on the object returned by ` getFeature ` .
176176
177- ### Feature Overrides
178-
179- You can override feature flags locally for testing purposes using ` setFeatureOverride ` :
180-
181- ``` ts
182- // Override a feature to be enabled
183- bucketClient .setFeatureOverride (" huddle" , true );
184-
185- // Override a feature to be disabled
186- bucketClient .setFeatureOverride (" huddle" , false );
187-
188- // Remove the override
189- bucketClient .setFeatureOverride (" huddle" , null );
190-
191- // Get current override value
192- const override = bucketClient .getFeatureOverride (" huddle" ); // returns boolean | null
193- ```
194-
195- Feature overrides are persisted in ` localStorage ` and will be restored when the page is reloaded.
196-
197177### Remote config (beta)
198178
199179Similar to ` isEnabled ` , each feature has a ` config ` property. This configuration is managed from within Bucket.
Original file line number Diff line number Diff line change @@ -770,15 +770,21 @@ export class BucketClient {
770770 } ;
771771 }
772772
773+ /**
774+ * @internal
775+ */
773776 setFeatureOverride ( key : string , isEnabled : boolean | null ) {
774777 this . featuresClient . setFeatureOverride ( key , isEnabled ) ;
775778 }
776779
780+ /**
781+ * @internal
782+ */
777783 getFeatureOverride ( key : string ) : boolean | null {
778784 return this . featuresClient . getFeatureOverride ( key ) ;
779785 }
780786
781- sendCheckEvent ( checkEvent : CheckEvent ) {
787+ private sendCheckEvent ( checkEvent : CheckEvent ) {
782788 return this . featuresClient . sendCheckEvent ( checkEvent , ( ) => {
783789 this . hooks . trigger (
784790 checkEvent . action == "check-config" ? "configCheck" : "enabledCheck" ,
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export type FetchedFeature = {
2020
2121 /**
2222 * Result of feature flag evaluation.
23+ * Note: does not take local overrides into account.
2324 */
2425 isEnabled : boolean ;
2526
@@ -71,9 +72,11 @@ export type FetchedFeature = {
7172
7273const FEATURES_UPDATED_EVENT = "featuresUpdated" ;
7374
75+ /**
76+ * @internal
77+ */
7478export type FetchedFeatures = Record < string , FetchedFeature | undefined > ;
7579
76- // todo: on next major, come up with a better name for this type. Maybe `LocalFeature`.
7780export type RawFeature = FetchedFeature & {
7881 /**
7982 * If not null, the result is being overridden locally
You can’t perform that action at this time.
0 commit comments