0.2.0 • Published 2 years ago

eap-consent v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@contentful/eap-consent

This package exposes a React component that can be used to ask for user's consent about the Early Access Program.

npm.io

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.

npm.io

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}
        />
    )