2.1.0 • Published 3 years ago

@swingby-protocol/ip-check v2.1.0

Weekly downloads
32
License
Apache-2.0
Repository
github
Last release
3 years ago

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);