You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@segment/in-eu

Package Overview
Dependencies
Maintainers
250
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@segment/in-eu

Privacy conscious EU detection browser library

0.4.0
latest
Source
npmnpm
Version published
Weekly downloads
65K
-3.68%
Maintainers
250
Weekly downloads
 
Created
Source

🇪🇺 in-eu

Privacy conscious EU detection browser library

in-eu is a library for roughly detecting whether a website user is in the EU, without requiring a roundtrip to your server or a lookup against a GeoIP database.

It uses the browser's timezone (via the brilliant jstz and locale (navigator.languages) to infer whether someone is in the EU. in-eu trades absolute accuracy for a cautious approach that's more lightweight and respectful of end-user privacy.

Usage

$ npm install @segment/in-eu
import inEU from '@segment/in-eu'

inEU()
// => true | false

or try one of the more specific helpers:

import { isInEUTimezone } from '@segment/in-eu'

/*
 Only checks the browser timezone.
 Useful for checking if someone is physically present in the EU
*/

isInEUTimezone()
// => true | false
import { isEULocale } from '@segment/in-eu'

/*
 Only uses the browser's language/locale
 Useful for checking if someone speaks an european language accounting
 for locale. e.g. pt-PT (portuguese from Portugal)
*/

isEULocale()
// => true | false

License

in-eu is released under the MIT license.

Keywords

gdpr

FAQs

Package last updated on 01 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts