# @financial-times/privacy-legislation-client

> ## What it is

Latest version **6.23.3** (published 2026-07-24) · 0 weekly downloads

## Install

```sh
npm install @financial-times/privacy-legislation-client
pnpm add @financial-times/privacy-legislation-client
yarn add @financial-times/privacy-legislation-client
bun add @financial-times/privacy-legislation-client
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.23.3 |
| Published | 2026-07-24 |
| First published | 2020-05-18 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | the-ft, rowanmanning, chee, alexwilson, aendra, emmalewis, notlee, hamza.samih, robertboulton, leila.micollier, robgodfrey |

## Links

- npm: https://www.npmjs.com/package/@financial-times/privacy-legislation-client
- npm.io page: https://npm.io/package/@financial-times/privacy-legislation-client

## Recent versions

- 6.23.3 (latest) — 2026-07-24
- 5.2.1-beta.6 (pre-release) — 2024-07-11
- 6.23.2 — 2026-07-21
- 6.23.1 — 2026-07-17
- 6.23.0 — 2026-07-13
- 6.22.4 — 2026-07-10
- 6.22.3 — 2026-07-09
- 6.22.2 — 2026-07-09
- 6.22.1 — 2026-07-08
- 6.22.0 — 2026-07-07
- 6.21.2 — 2026-07-03
- 6.21.1 — 2026-07-02
- 6.21.0 — 2026-06-30
- 6.20.1 — 2026-06-26
- 6.20.0 — 2026-06-26
- … 114 more at https://npm.io/package/@financial-times/privacy-legislation-client/versions

## README

# 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](../../examples/legislation-client/README.md)

## 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:

```js
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](../../vcl/legislation-api/README.md) for more details

---
_Source: https://npm.io/package/@financial-times/privacy-legislation-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
