@cleargdpr/js-sdk

ClearGDPR JS SDK

Usage no npm install needed!

<script type="module">
  import cleargdprJsSdk from 'https://cdn.skypack.dev/@cleargdpr/js-sdk';
</script>

README

JS-SDK

npm (scoped)

SDK design is based on several patterns, but main idea is to provide a way to abstract calls to the CG API, and have a way to trigger internal Events when some specific actions is done.

Table of Contents

Architecture

├─ config
├─ scripts
└─ src
    ├─ common     # Reusable functions
    ├─ factories  # Service provider of different functions
    ├─ modules    # Each module represents a specification of the CG API
    ├─ cg.js      # CG SDK definition require Token and register all the modules
    ├─ events.js  # Events subscription/notification used by different flows
    ├─ config.js  # Default configuration, could be overwritten
    └─ index.js

Related reads