Skip to content

SwingbyProtocol/ip-check

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published