@auth0/auth0-acul-react - v1.9.0
    Preparing search index...

    Variable useExperiment

    useExperiment: () => ExperimentMembers | null | undefined

    Type Declaration

      • (): ExperimentMembers | null | undefined
      • Hook to access the active Experiment Center experiment for the current screen.

        Returns ExperimentMembers | null | undefined

        Experiment object (experimentId, variationId, variationName, variationDescription, config, isControl), or null when no experiment is active or the screen has not opted in via context_configuration

        import { useExperiment } from '@auth0/auth0-acul-react/login-id';
        function ExperimentBranch() {
        const experiment = useExperiment();
        if (!experiment) return null;
        return experiment.isControl ? <ControlUI /> : <TreatmentUI />;
        }