ephys / do-not-track

Module to check the value of the DNT header

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

do-not-track

Accessing the user's preferences in terms of tracking can be slightly complicated. This module simplifies that.

Install

npm install --save donottrack

Usage

Browser:

import doNotTrack from 'donottrack';

// Returns true if the user agrees to being tracked, false otherwise.
const mayTrack = doNotTrack(/* default, if preferences are not set. */ true);

Node:

import doNotTrack from 'donottrack';

const mayTrack = doNotTrack(req.header('DNT'), true);

About

Module to check the value of the DNT header


Languages

Language:JavaScript 100.0%