Env. variable secrets instructions unclear

I have read this page https://docs.replit.com/programming-ide/workspace-features/secrets and I have followed the instructions to get the variables printed in the shell but I don’t know where I insert these values in my app.

I am trying to do this tutorial Build a User Management App with NextJS | Supabase Docs so I have the variables named

NEXT_PUBLIC_SUPABASE_URL=YOUR_SUPABASE_URL
NEXT_PUBLIC_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY

where do I insert process.env.NEXT_PUBLIC_SUPABASE_URL in the nextjs application code to instruct the files where to find these values?

I was able to get this to work with

const SUPABASE_URL = process.env.NEXT_PUBLIC_SUPABASE_URL
const SUPABASE_ANON_KEY 
 = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY

but is that correct way to access these values in the Secrets tool?

1 Like

AFAIK, yes, that is the correct way to access them.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.