Open noga-dev opened 1 year ago
Secrets can be read using
Deno.env.get('VARIABLE_NAME')
Secrets must be managed by Supabase CLI with standard supabase secrets list/set
commands. Secrets are written in environment files (DO NOT ADD THEM TO GIT, exclude them in .gitignore
):
./supabase/.env
(for PRODUCTION)
./supabase/.env.local
(for local dev)
In order to make work local secrets during development, you need to add an extra --env-file file
parameter to your serve command:
supabase functions serve dart_edge --no-verify-jwt --env-file ./supabase/.env.local
You can check this in the video https://youtu.be/53jhgrDONW4
Hope this helps
PS: Maybe we should add this to the README.md
, isn't it?
Oh, I didn't realize I had access to Deno as an object inside main.dart. Thanks for this!
Works great and should definitely be added to the readme.
Leaving this issue open for the maintainers to address the docs/readme.
The env var SUPABASE_URL comes built in as a default secret, per https://supabase.com/docs/guides/functions/secrets, yet defaultVal is returned.