0.2.0 • Published 2 years ago
eap-consent v0.2.0
@contentful/eap-consent
This package exposes a React component that can be used to ask for user's consent about the Early Access Program.
The component will only render when the app is not installed, when the user clicks on install without acknowledging the EAP consent an error notification will pop up.
Installation
npm add --save @contentful/eap-consent
Usage
import { EAPConsent } from '@contentful/eap-consent';
const [isEAPConsentGiven, setIsEAPConsentGiven] = useState(false);
const [isAppInstalled, setIsAppInstalled] = useState(false);
const sdk = useAppSDK();
const Component = () => {
return (
<EAPConsent
setIsAppInstalled={setIsAppInstalled}
isAppInstalled={isAppInstalled}
isEAPConsentGiven={isEAPConsentGiven}
setIsEAPConsentGiven={setIsEAPConsentGiven}
appName="Merge app"
appTermsURL={termsURL}
sdk={sdk}
/>
)
0.2.0
2 years ago