deploy_feedback icon indicating copy to clipboard operation
deploy_feedback copied to clipboard

GeoLocation API

Open ghost opened this issue 3 years ago • 1 comments

Is there any way of getting a GeoLocation data from a request to personalize the response? There are a lot of use cases of GeoLocation data, like serving contents based on country where these user is requesting from, Internationalization, making discounts based on country currency, serving optimized sites based on country, more...

Just look how Cloudflare Workers implemented these in here: https://blog.cloudflare.com/location-based-personalization-using-workers/

It might not be a frequency used feature, but it's also easy because edge computing gives us a way of running code closer to a end user, so we can retrieve GeoLocation data from the request sent from a user.

Note that these doesn't mean for sensitive data like an approximate location, users identity & things like that.

ghost avatar Mar 24 '22 19:03 ghost

Vercel also supports it via custom request headers: https://vercel.com/docs/concepts/edge-network/headers#x-vercel-ip-country

From my experience working with custom headers is easier than custom request property when using Typescript.

izznat avatar Sep 11 '22 12:09 izznat