@hashicorp/react-consent-manager

A GDPR-compliant Consent Manager

Usage no npm install needed!

<script type="module">
  import hashicorpReactConsentManager from 'https://cdn.skypack.dev/@hashicorp/react-consent-manager';
</script>

README

Consent Manager

A GDPR-compliant consent manager.

Props

  • version (integer) - version number, bump up to override previous consent preferences
  • container (string) - id of container where the consent manager should live
  • companyName (string) - your company name to be inserted in various copy
  • privacyPolicyLink (string) - link to your company's privacy policy
  • segmentWriteKey (string) - your production segment write key
  • segmentServices (array of objects) - use this to override the category or description of a service provided by Segment
    • name - name of the Segment integration, must match the integration you are overriding
    • utilServerRoot - root path of the instance of HashiCorp's web-utility-server to use. This is used to fetch integrations based on segment write key.
    • category [optional] - new category name
    • description [optional] - new description
  • categories (array) - State of toggle
    • name - name of category
    • description - description for the category
  • additionalServices (array of objects) - additional integrations outside of Segment that you wish to include in the consent manager
    • name - name of service
    • description - description of service
    • category - category of service
    • body [optional] - javascript body associated with service If present, overrides url below
    • url [optional] - url of js file associated with service
    • async (bool) [optional] - add async property to script element
    • addToBody (bool) [optional] - inject script before closing <body> tag
    • dataAttrs (arr) [optional] - array of data- attributes to add to script tag
      • name (str) - name of data attribute (data-name)
      • value (str) - value of data attribute to set