Integrate betterAuth with React-Router v7 cloudflare template
Hi, I am currently using RR7 framework mode with cloudflare template. This template allows you to use all of the services from cloudflare in action and loader through a prop. For example, let's say you need to use KV store from cloudflare in your RR7 app. You can do something like this:
export async function loader({context}: Route.LoaderArgs){
const value = context.cloudflare.env.SECOND_STORAGE.get(key) //SECOND_STORAGE is binding name to use KV store
//Do something
}
The problem I am encountering is that I want to use cloudflare KV's store to set up second storage for the betterAuth instance. However, the context is only exposed through the prop context passed through loader and action. I dont know how access the kv store in other ways. Any ideas?
Thanks for reading this.0 Replies