Add native_pwi_disabled
feature gate experiment (#4507)
* Add native_pwi_disabled feature gate experiment * Use const
This commit is contained in:
parent
f5f3bd8130
commit
332524b7de
4 changed files with 25 additions and 5 deletions
|
@ -1,5 +1,6 @@
|
|||
export type Gate =
|
||||
// Keep this alphabetic please.
|
||||
| 'native_pwi_disabled'
|
||||
| 'request_notifications_permission_after_onboarding_v2'
|
||||
| 'show_avi_follow_button'
|
||||
| 'show_follow_back_label_v2'
|
||||
|
|
|
@ -14,6 +14,8 @@ import {useNonReactiveCallback} from '../hooks/useNonReactiveCallback'
|
|||
import {LogEvents} from './events'
|
||||
import {Gate} from './gates'
|
||||
|
||||
const SDK_KEY = 'client-SXJakO39w9vIhl3D44u8UupyzFl4oZ2qPIkjwcvuPsV'
|
||||
|
||||
type StatsigUser = {
|
||||
userID: string | undefined
|
||||
// TODO: Remove when enough users have custom.platform:
|
||||
|
@ -251,7 +253,7 @@ AppState.addEventListener('change', (state: AppStateStatus) => {
|
|||
})
|
||||
|
||||
export async function tryFetchGates(
|
||||
did: string,
|
||||
did: string | undefined,
|
||||
strategy: 'prefer-low-latency' | 'prefer-fresh-gates',
|
||||
) {
|
||||
try {
|
||||
|
@ -275,6 +277,10 @@ export async function tryFetchGates(
|
|||
}
|
||||
}
|
||||
|
||||
export function initialize() {
|
||||
return Statsig.initialize(SDK_KEY, null, createStatsigOptions([]))
|
||||
}
|
||||
|
||||
export function Provider({children}: {children: React.ReactNode}) {
|
||||
const {currentAccount, accounts} = useSession()
|
||||
const did = currentAccount?.did
|
||||
|
@ -320,7 +326,7 @@ export function Provider({children}: {children: React.ReactNode}) {
|
|||
<GateCache.Provider value={gateCache}>
|
||||
<StatsigProvider
|
||||
key={did}
|
||||
sdkKey="client-SXJakO39w9vIhl3D44u8UupyzFl4oZ2qPIkjwcvuPsV"
|
||||
sdkKey={SDK_KEY}
|
||||
mountKey={currentStatsigUser.userID}
|
||||
user={currentStatsigUser}
|
||||
// This isn't really blocking due to short initTimeoutMs above.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue