denoland / deploy_feedback

For reporting issues with Deno Deploy
https://deno.com/deploy
74 stars 5 forks source link

GeoLocation API #186

Open ghost opened 2 years ago

ghost commented 2 years ago

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.

izznatsir commented 2 years ago

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.