Complete the code to access an environment variable in Supabase.
const apiKey = process.env.[1];The environment variable SUPABASE_API_KEY holds the API key needed to authenticate requests.
Complete the code to load environment variables from a .env file using Supabase CLI.
supabase functions deploy --env-file [1]The standard filename for environment variables is .env.
Fix the error in the code to securely access a secret in a Supabase Edge Function.
const secret = Deno.env.[1]('MY_SECRET');
In Deno, environment variables are accessed using Deno.env.get().
Complete the code to set and access a secret in Supabase Edge Functions.
Deno.env.[1]('MY_SECRET', 'secure_value'); const secret = Deno.env.get('MY_SECRET');
Use Deno.env.set(key, value) to set an environment variable in the current Deno process. For production secrets in Supabase Edge Functions, use the CLI command supabase secrets set MY_SECRET=secure_value instead.
Fill all three blanks to create a secure connection using environment variables in Supabase.
const supabaseUrl = process.env.[1]; const supabaseKey = process.env.[2]; const supabase = createClient([3], supabaseKey);
Use SUPABASE_URL and SUPABASE_API_KEY environment variables to get the URL and key. Then pass the URL variable supabaseUrl to createClient.