How to read environment variable from CF Dashboard in Astro?
I tried to read my env variables using
const supabaseUrl = import.meta.env.SUPABASE_URL;
and it doesn't work.
In https://docs.astro.build/en/guides/integrations-guide/cloudflare/#cloudflare-runtime, it shows const { env } = Astro.locals.runtime;
.
However, I have a compiler error that Astro is not defined
. How can I import this Astro variable?Docs
@astrojs/cloudflare
Learn how to use the @astrojs/cloudflare SSR adapter to deploy your Astro project.
0 Replies