How can I use geolocation IP headers?

👋 Hello!

I’m using SvelteKit with the
@sveltejs/adapter-cloudflare
, deploying to Cloudflare Pages.

Some websites show a nice touch like:

Last visitor from Munich, Bavaria


On Vercel, I’ve seen this done easily with:

import { geolocation } from '@vercel/functions';


Is there an equivalent or best practice for doing this on Cloudflare Pages?

Any pointers or examples would be much appreciated!

---
Was this page helpful?