ccpa-string-builder
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

CCPA String Builder - JavaScript helper library

JavaScript library for building CCPA String. Compliant with the US Privacy String spec 1.0 written by IAB.

Installation

  • With NPM npm install ccpa-string-builder --save

  • With Yarn yarn add ccpa-string-builder

Usage

This library works with Node and Browser environments.

CommonJS

const CCPAStringBuilder = require('ccpa-string-builder')

JavaScript modules

import CCPAStringBuilder from 'ccpa-string-builder'

To generate the string, use following syntax:

const privacyString = CCPAStringBuilder({
  explicitOptOut: true,
  optOutSale: true,
  lspa: true,
})

will produce 1YYY

const privacyString = CCPAStringBuilder({})

will produce 1---

You may pass either undefined (Not Applicable) or boolean value for explicitOptOut, optOutSale, or lspa properties. Omitting parameter is the same as passing undefined.

Definitions of each component can be found here

Readme

Keywords

Package Sidebar

Install

npm i ccpa-string-builder

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

13.5 kB

Total Files

5

Last publish

Collaborators

  • olancheg