webrtc·ip

Your IP,
resolved pretty fast.

webrtc-ip webrtc-ip uses the browser’s WebRTC stack to discover your public IP via a STUN request. It avoids a traditional HTTP IP-check endpoint, so there are no API keys, rate limits, or REST response parsing, but it still performs a network round trip to a STUN server.

Speedup vs. fetch
Your WebRTC latency
Package size
9.5 kB
Dependencies
0
§ 01 — Comparison
live-benchmark.tsx
webrtc-ip
0.00×
faster than the average fetch() against public IP providers.
Implementation
import { getIP, prefetchIP } from "webrtc-ip";

void prefetchIP().catch(() => undefined);

getIP()
  .then((my_ip) => {
    console.log(my_ip);
  })
  .catch(console.error);
Returned IP —
§ 02 — Installation

Simple installation.