react-esquio
v1.0.2
Published
Esquio FeatureFlags for React
Downloads
3
Readme
react-esquio ·
Esquio FeatureFlags from React, using hooks.
Quickstart
import {FeatureFlagProvider} from 'react-esquio';
return (
<FeatureFlagProvider
value={{
apiKey: 'apiKey',
url: 'https://test',
product: 'product',
deployment: 'deployment'
}}>
...
</FeatureFlagProvider>
);
import {useFeatureFlags} from 'react-esquio';
const [canCreate, canUpdate] = useFeatureFlags('Create', 'Update');
Toggles
Currently only the Identity Claim Value Toggle is supported. Token can be provided to FeatureFlagProvider as toggles
import {claimValueToggle} from 'react-esquio';
<FeatureFlagProvider
value={{
...,
toggles: claimValueToggle(tokenParsed)
}}>
...
</FeatureFlagProvider>