I have a suggestion that would significantly improve the utility of Netlify’s IP geolocation feature, by passing this information to the client browser by means of a cookie.
It works as follows:
- When a visitor visits a website, Netlify’s edge performs geoip lookup and (optionally) sets a cookie e.g. netlify_geoip.
- A clientside app running in the browser could read the netlify_geoip cookie and get the geoip info.
- Any app that didn’t implement this cookie would just ignore it.
Such a method could also make request headers available to the app.
At present, there’s no straightforward way of doing geoip in a clientside react app. This is the kind of feature that makes it easy, and is what makes Netlify a dream vs roll-your-own.