#How to auto detect region?

21 messages · Page 1 of 1 (latest)

half bear
#

I spun up Medusa with the nextjs storefront, but it doesn't look like the storefront auto detects the region. Should this be something built into the core backend with something like maxmind?

honest wedge
#

You could create a plugin or just add it as a custom service to your Medusa server. We have a plugin for IPStack, but you are free to use whatever service you wish to use. Since IP look ups are a paid service, I can’t see it become a core part of Medusa, but something that users can handle through plugins 🙂

half bear
#

But I guess another plugin is probably the best route

#

Can I try and contribute a maxmind plugin?

half bear
formal stag
#

Hey @half bear how can you "implement" this with the storefront so it autoselects the region? Do you have any examples? Thanks!

half bear
formal stag
half bear
formal stag
#

I'm seeing a bunch of IPs in the logs but those are neither UK or my current IP

half bear
formal stag
half bear
formal stag
#

I'm adding x-vercel-forwarded-for to the plugin to verify if that solves it

formal stag
half bear
formal stag
half bear