@datafund/consent-generator
React plugin for generating a Consent Receipt (CR) JSON server-side.
Last updated a year ago by markuszw .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @datafund/consent-generator 
SYNC missed versions from official npm registry.

Consent Generator

React plugin for generating a Consent Receipt (CR) JSON server-side.

Quick Use

Download package using npm:

$ npm install --save @datafund/consent-generator


Import package to your React app:

import { ConsentGenerator } from 'consent-generator';


Prepare Consent Receipt data:

let formData = {
   "version": "Kantara_v1.1",
    "consentTimestamp": 1559734117,
    "collectionMethod": "Web form",
    "consentReceiptID": "d03bdfed-708a-4792-b6d2-eb336000359f",
    "publicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnzyis1ZjfNB0bBgKFMSv\nvkTtwlvBsaJq7S5wA+kzeVOVpVWwkWdVha4s38XM/pa/yr47av7+z3VTmvDRyAHc\naT92whREFpLv9cj5lTeJSibyr/Mrm/YtjCZVWgaOYIhwrXwKLqPr/11inWsAkfIy\ntvHWTxZYEcXLgAXFuUuaS3uF9gEiNQwzGTU1v0FqkqTBr4B8nW3HCN47XUu0t8Y0\ne+lf4s4OxQawWD79J9/5d3Ry0vbV3Am1FtGJiJvOwRsIfVChDpYStTcHTCMqtvWb\nV6L11BWkpzGXSW4Hv43qa+GSYOD2QU68Mb59oSk2OB+BtOLpJofmbGEGgvmwyCI9\nMwIDAQAB\n-----END PUBLIC KEY-----",
    "language": "English",
    "piiPrincipalId": "individual@example.com",
    "piiControllers": [
      {
        "address": {},
        "piiController": "Datafund",
        "contact": "Jani Podatek",
        "email": "info@datafund.io",
        "phone": "+386 0000000",
        "piiControllerUrl": "http://datafund.io"
      }
    ],
    "policyUrl": "https://datafund.io/legal/privacy_policy.html",
    "services": [
      {
        "service": "Service example 1",
        "purposes": [
          {
            "purpose": "Core Function",
            "consentType": "explicit",
            "purposeCategory": [
              "Billing"
            ],
            "piiCategory": [
              "Email",
              "Phone number"
            ],
            "primaryPurpose": true,
            "termination": "1 year",
            "thirdPartyDisclosure": false
          }
        ]
      },
      {
        "service": "Service example 2",
        "purposes": [
          {
            "purpose": "Marketing",
            "consentType": "explicit",
            "purposeCategory": [
              "Direct marketing",
              "Delivery"
            ],
            "piiCategory": [
              "Home address",
              "Email address",
              "Phone number"
            ],
            "termination": "1 year",
            "thirdPartyDisclosure": true,
            "thirdPartyName": "AnalyticsRus"
          }
        ]
      }
    ],
    "sensitive": true,
    "spiCat": [
      "Health status",
      "Genetic data"
    ],
    "jurisdiction": "SI"
}


Add API root URL parameter:

let APIroot = "http://localhost:5000/api/v1/"


Add properties for verifying token:

let verifyOptions = {
                issuer: "issuer",
                subject: "subject",
                audience: "audience",
                expiresIn: "12h",
                algorithm: "RS256"
}


Include component in render() method of your app:

<ConsentGenerator formData={{formData}} APIroot={{APIroot}} verifyOptions={{verifyOptions}} />

Props :hammer_and_wrench:

  • formData (json)
  • APIroot (string)
  • verifyOptions (json)

Current Tags

  • 0.1.2                                ...           latest (a year ago)

2 Versions

  • 0.1.2                                ...           a year ago
  • 0.1.0                                ...           a year ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (14)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |