@swingby-protocol/ip-check
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

Small util to check a user's country by IP and whether access to our product should be restricted.

Getting started

  1. Install with yarn add @swingby-protocol/ip-check.
  2. Get an API key for ipapi.co. (Optional)
import { getIpInfo, shouldBlockRegion } from '@swingby-protocol/ip-check';

const ipInfo = await getIpInfo({ ip: '…', ipApiKey: '…' });
const yesOrNo = shouldBlockRegion(ipInfo);

Package Sidebar

Install

npm i @swingby-protocol/ip-check

Weekly Downloads

2

Version

2.1.0

License

Apache-2.0

Unpacked Size

244 kB

Total Files

20

Last publish

Collaborators

  • agupane
  • notatestuser
  • swingby-ci
  • tarrio
  • syrohei