File tree 3 files changed +11
-1
lines changed
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ if (typeof window !== 'undefined') {
67
67
opt_in_site_apps : true ,
68
68
__preview_remote_config : true ,
69
69
__preview_experimental_cookieless_mode : false ,
70
+ __preview_flags_v2 : true ,
70
71
...configForConsent ( ) ,
71
72
} )
72
73
// Help with debugging
Original file line number Diff line number Diff line change @@ -502,6 +502,11 @@ exports[`config snapshot for PostHogConfig 1`] = `
502
502
\\" false\\ " ,
503
503
\\" true\\ "
504
504
],
505
+ \\" __preview_flags_v2\\ " : [
506
+ \\" undefined\\ " ,
507
+ \\" false\\ " ,
508
+ \\" true\\ "
509
+ ],
505
510
\\" api_method\\ " : [
506
511
\\" undefined\\ " ,
507
512
\\" string\\ "
Original file line number Diff line number Diff line change @@ -390,6 +390,10 @@ export class PostHogFeatureFlags {
390
390
data . disable_flags = true
391
391
}
392
392
393
+ // NB: flags v2 requires remote config to be enabled as well, since the idea is that we will skip calling /decide altogether
394
+ // (which remote config does) and just use the /flags endpoint. May revisit this if we need to support flags v2 without remote config
395
+ // (e.g. we could call `/decide` with flags disabled for the data otherwise returned by remote config, and then still call
396
+ // `/flags/` to get the flag evaluation data).
393
397
const eligibleForFlagsV2 =
394
398
this . instance . config . __preview_flags_v2 && this . instance . config . __preview_remote_config
395
399
@@ -415,8 +419,8 @@ export class PostHogFeatureFlags {
415
419
416
420
this . _requestInFlight = false
417
421
422
+ // NB: this block is only reached if this.instance.config.__preview_remote_config is false
418
423
if ( ! this . _decideCalled ) {
419
- // NB: this will be true if remote config is enabled, which it is for the default posthog app api key
420
424
this . _decideCalled = true
421
425
this . instance . _onRemoteConfig ( response . json ?? { } )
422
426
}
You can’t perform that action at this time.
0 commit comments