Skip to content

feat: add cf context option for universal framework support#2

Merged
zpg6 merged 13 commits intozpg6:mainfrom
imjlk:add-cf-context-option
Jun 6, 2025
Merged

feat: add cf context option for universal framework support#2
zpg6 merged 13 commits intozpg6:mainfrom
imjlk:add-cf-context-option

Conversation

@imjlk
Copy link
Contributor

@imjlk imjlk commented Jun 4, 2025

Resolve #1

This PR adds a new cf option to CloudflarePluginOptions that allows users to provide their own Cloudflare geolocation context, enabling better integration with various frameworks like OpenNext, Hono, Sveltekit, and others.

I haven’t applied it with the Opennext example yet, but how about trying to do it this way? I made the changes minimally. Please take a look. Thanks!

@zpg6
Copy link
Owner

zpg6 commented Jun 4, 2025

This is great! Can you add an example with Hono or one of the other frameworks?

@zpg6
Copy link
Owner

zpg6 commented Jun 6, 2025

Hi @imjlk - this is working great so far. I tested with the opennextjs example (it is what's live on Demo Site)... also decided to make the geolocation type a bit more flexible.

Can you add an example with Hono or one of the other frameworks? Added already :)

@zpg6 zpg6 merged commit 6354634 into zpg6:main Jun 6, 2025
2 checks passed
@imjlk
Copy link
Contributor Author

imjlk commented Jun 7, 2025

Wow, thank you! Haha, I was a bit lacking, but you wrapped it up quickly. I’ll try to submit a PR with a SvelteKit example next time. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove @opennextjs/cloudflare Dependency

2 participants