top of page
bottom of page
// backend/getIP.jsw import { fetch } from 'wix-fetch'; export async function getVisitorIP() { try { const response = await fetch("https://api.ipify.org?format=json", { method: "get" }); if (response.ok) { const json = await response.json(); return json.ip; // returns the visitor's IP address } else { return "Error fetching IP"; } } catch (err) { console.error("IP fetch failed", err); return "Unavailable"; } }