@swingby-protocol/ip-check
v2.1.0
Published
Small util to check a user's country by IP and whether access to our product should be restricted
Downloads
9
Readme
Small util to check a user's country by IP and whether access to our product should be restricted.
Getting started
- Install with
yarn add @swingby-protocol/ip-check
. - 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);