New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ipify

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipify

Get your public IP address

  • 6.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
373
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

ipify

Get your public IP address

Using the Ipify API or a custom Ipify instance.

Install

npm install ipify

Usage

import ipify from 'ipify';

console.log(await ipify());
//=> '2001:0db8:85a3:0000:0000:8a2e:0370:7334'

API

ipify(options?)

Returns a Promise<string> with an IP address.

options

Type: object

useIPv6

Type: boolean
Default: true

Use the IPv6 API endpoint. The IPv6 endpoint will return an IPv6 address if available, IPv4 address otherwise.

Setting the endpoint option will override this.

import ipify from 'ipify';

console.log(await ipify({useIPv6: false}));
//=> '82.142.31.236'
endpoint

Type: string
Default: 'https://api6.ipify.org'

Custom API endpoint.

FAQ

How is this different from public-ip?

This package only targets the Ipify service, while public-ip targets multiple services, is faster, and more resilient. Unless you run your own Ipify instance, you probably want public-ip instead.

  • ipify-cli - CLI for this module
  • internal-ip - Get your internal IPv4 or IPv6 address

Keywords

FAQs

Package last updated on 01 Jan 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc