Api key woking locally but not after deployment

Hello,

My site name is https://griffwong.netlify.app/

I am using environment variables to hide my api keys. My Email form works locally, but not after deployment. Am I inputting my environment variables in the configuration settings correctly?

For example, if my API key is

VITE_API_Key : “abc”

On Netlify in the configuration settings, I would input API_key as the key and “abc” as the value right? Or should I simply input abc as the value without the quotation marks?

You add a key with the exact value you are using.

You enter the value exactly as you want it. abc !== "abc"

If you are using this in front-end code the key will not remain hidden.

Thanks for the heads up on hiding the API Key. I have inputed my key and values into the configuration settings exactly as it is in my .env file. It works locally but not after deployment. Am I missing something?

1 Like

Read this support guide

Based on the information you’ve provided I can offer no further advice.

Did you ever get this figured out? Something I am trying to deploy is demanding I have my info in a supabaseClient.js but that info should be pulled from the env set up in netlify. The project I am working on has the env setup to have a vari for supabaseUrl, supabaseAnonKey like the docs, people and ai says I should do.

If you need help, you should share the site name and reproduction steps.