
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
react-ip-location
Advanced tools
Get your ip address and location with just a single line of code; get location information of a provided ip address
react-ip-locationSimplest, lightest and fastest JS library to get your ip address and location.
Check current location by a provided ip address.
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|---|---|---|---|---|---|
| Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |
Using yarn:
$ yarn add react-ip-location
Using npm:
$ npm install react-ip-location
import React from 'react';
import { getIPLocation, checkIPLocation, getIPAddress } from 'react-ip-location';
export const App = () => {
// In your component
const getMyIP = async () => {
const location = await getIPLocation(); // { ip: "116.255.54.11", country: "AU" }
const checkLocation = await checkIPLocation('42.115.92.231'); // // { ip: "42.115.92.231", country: "AU" }
const ip = await getIPAddress(); // 116.255.54.11
};
getMyIP();
return <div>PAGE COTNENT</div>
};
MIT © WillyVox
FAQs
Get your ip address and location with just a single line of code; get location information of a provided ip address
The npm package react-ip-location receives a total of 885 weekly downloads. As such, react-ip-location popularity was classified as not popular.
We found that react-ip-location demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.