Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@mdnx/express-cloudfront-gdpr

1.0.0-alpha.3 • Public • Published

NPM version npm module downloads per month

Express Cloudfront GDPR & CCPA Middleware

This package provides a express middleware to detect if GDPR or CCPA applies for a user by inspecting aws cloudfront headers.

Installation / Use in TypeScript projects

npm install @mdnx/express-cloudfront-gdpr --save

Usage

To create a response header with gdpr flag:

import express from 'express';
import { gdprHeaderMiddleware } from '@mdnx/express-cloudfront-gdpr';
 
const app = express();
app.use(gdprHeaderMiddleware({
  headerName: 'X-Gdpr-Applies',
  headerTrueValue: '1',
  headerFalseValue: '0',
}));

To create a response header with ccpa flag:

import express from 'express';
import { ccpaHeaderMiddleware } from '@mdnx/express-cloudfront-gdpr';
 
const app = express();
app.use(ccpaHeaderMiddleware({
  headerName: 'X-Ccpa-Applies',
  headerTrueValue: '1',
  headerFalseValue: '0',
}));

Install

npm i @mdnx/express-cloudfront-gdpr

DownloadsWeekly Downloads

2

Version

1.0.0-alpha.3

License

MIT

Unpacked Size

47.7 kB

Total Files

71

Last publish

Collaborators

  • avatar