@mdnx/express-cloudfront-gdpr
v1.0.0-alpha.3
Published
express middleware to detect if gdpr or ccpa applies with the help of aws cloudfront
Downloads
2
Maintainers
Readme
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',
}));