Deploying on cloudflare? what are the best practise to deal with env variables?
when to retrieve env secret for examples for the database connection, or event better-auth settings?
on global context?
using a global middleware?
3 Replies
national-gold•3mo ago
This might be helpful to you: https://developers.cloudflare.com/workers/framework-guides/web-apps/tanstack/
It's good to know that env vars and secrets are exposed on
process.env for newer cloudflare workers (along with other bindings).
You can also import the env bindings from the workers:cloudflare package, which for now only works in production afaik. This might change when Tanstack Start decouples from Nitro and we can use the official Cloudflare Vite plugin instead:
Cloudflare Docs
TanStack
Create a TanStack Start application and deploy it to Cloudflare Workers with Workers Assets.
continuing-cyanOP•3mo ago
oh nice, missed the bindings.ts
didnt know they were a de-nitro going on
national-gold•3mo ago
From my understanding, it's just a decoupling so that you have the option of using Nitro or another Vite plugin, like Cloudflare's.