5.5.3 • Published 10 months ago

@financial-times/privacy-legislation-client v5.5.3

Weekly downloads
727
License
-
Repository
-
Last release
10 months ago

Privacy Legislation Client

What it is

A module that reports which privacy-related legislation applies in the user's current location.

Available for both server and client: see example

Usage

Typical usage would be to add the module to your app, call the imported method and then update the UI in line with any applicable legal requirements:

import { fetchLegislation, buildConsentPageUrl } from "@financial-times/privacy-legislation-client";

function onPageLoad() {
  /**
   * `legislation`: a Set of applicable laws: "ccpa", "gdpr", etc
   * `region`: Identifies countries or subdivisions - "GB", "US-CA"
   */ 
  const { legislation, region } = await fetchLegislation();

  // Contruct a standardised URL for the Consent Page, embedding legislation  & referrer
  const url = buildConsentPageUrl({ url: "...", legislation })

  if(legislation.has("ccpa")) {
    insertCCPALink(url)
  }

  if(legislation.has("gdpr")) {
    ...
  }
}

How it works

This module is a lightweight wrapper over the Fetch API that hits https://privacy.ft.com/api/v1/compliance-region.json, and exposes the comma-delimted response as a property called legislation in the form of a Set.

The abstraction allows us to change implementation details like the API's URL, version, etc. without impacting consumers

See the legislation-api for more details

5.5.3

10 months ago

5.5.1

11 months ago

5.5.0

11 months ago

5.3.0

1 year ago

5.2.1-beta.6

1 year ago

5.1.1

1 year ago

5.1.0

1 year ago

5.2.1-beta.3

1 year ago

5.2.1-beta.4

1 year ago

5.2.1-beta.1

1 year ago

5.2.1

1 year ago

5.2.0

1 year ago

5.2.0-beta.1

1 year ago

0.0.0-backup.1

1 year ago

5.5.2

11 months ago

5.0.1

1 year ago

5.0.0

1 year ago

4.2.0-beta.1

1 year ago

4.1.0

1 year ago

4.0.0

1 year ago

3.5.0-beta.1

1 year ago

3.5.0-beta.2

1 year ago

3.4.0-beta.2

1 year ago

3.4.0-beta.1

1 year ago

3.3.0

1 year ago

3.3.0-beta.5

1 year ago

3.3.0-beta.4

1 year ago

3.1.4

2 years ago

3.2.0

2 years ago

3.1.3

2 years ago

3.1.2

2 years ago

0.0.0-beta.2

2 years ago

3.1.1

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

3.0.1-alpha

2 years ago

2.0.5-beta.3

2 years ago

2.0.5-beta.2

2 years ago

2.0.4-alpha

2 years ago

1.3.0

2 years ago

3.0.1-beta

2 years ago

2.2.1

2 years ago

2.0.3

2 years ago

2.2.3-alpha

2 years ago

2.2.0

2 years ago

2.0.2

2 years ago

2.2.2

2 years ago

2.0.4

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

0.0.0-beta.1

2 years ago

1.0.0

5 years ago

0.3.9

5 years ago

0.3.10

5 years ago

0.3.8

5 years ago

0.3.7

5 years ago

0.3.6

5 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago