@funkit/connect
Version:
Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.
20 lines (19 loc) • 1.01 kB
TypeScript
import { defaultFeatureGates as fallbackFeatureGates } from '@funkit/connect-core';
type FeatureGateName = keyof typeof fallbackFeatureGates;
/**
* Synchronous, non-hook variant of {@link useFeatureGate}. Reads the gate
* value directly from the connect package's Statsig client singleton.
*
* Use this from non-React contexts (event handlers, async callbacks created
* outside render) where calling a hook is not possible. Behavior:
* - Returns the live gate value once `FunkitStatsigProvider`'s async init
* has resolved (typical case for event-driven calls — by the time a user
* clicks a button, init has long since completed).
* - Returns the bundled default if called before init completes or if the
* provider has not been mounted (graceful fallback rather than throw).
*
* For render-time consumers, prefer {@link useFeatureGate} so the consumer
* re-renders when values update mid-session.
*/
export declare function checkFeatureGate(name: FeatureGateName): boolean;
export {};