Hi !
I am trying to create a file .env
But the replit says that you can create environment files wth secret tools.
But how?
Hi !
I am trying to create a file .env
But the replit says that you can create environment files wth secret tools.
But how?
This is a guide on using secrets in the workspace:
https://docs.replit.com/programming-ide/workspace-features/secrets
Ok i’ll see thank you
When I click the option edit as JSON it sys "Secrets are specified in JSON. Values must be stringd.
what to do now?
It is easier to use the ui to create secrets, but if you want to edit the json, you may do this:
{
“SECRET_NAME”: “SECRET_VALUE”
}
Shouldn’t I put the secret name and values or something
It is saying make sure the data is valid
yes replace SECRET_NAME and SECRET_VALUE by your desired secret name and value.
I recommend learning how to use json before editing the raw values
May I see your json code
What is that Actually I am new
Btw what is m secret value and name?
Show me a screenshot of your secrets please
Instead of doing that, click the + New
button and enter your secret name and value.
I put a random secret valuse and keyand what should i do then
Click the create button and create the secret. Did you read the replit guide to using secrets i sent?
yes
and I aslod done client login process env.MY secret but should I copy it and where should I put it
If you created a secret in the ui, you can do:
const myToken = process.env.SECRET_NAME
replace SECRET_NAME with the name of the secret you created
Should I write it in front of console.log(process.env.MY_SECRET)
if you just need to print the secret, no reason to defined a constant for it