Ask coding questions

← Back to all posts
How to add secret keys when using html,js, css
ztjona (2)

Hi, I am new to replit, so far it seems really good and easy.
I saw that when using python, I can "keep secrets" and add databases, but I do not find the same options for html, js, css.

How I am suppose to handle api keys or something?
Should I instead try to make my website on python?

RoBlockHead (552)

with HTML, there's no way to keep secrets, because the files you put in HTML are just directly sent to the client, so any secrets you set and use in HTML or JS are sent to the user, so they can see it. If you're using secrets, you'd probably want to use a webserver such as express or flask.

98129182 (8)

As RoBlockHead said, build it on Node.js or Python.
For Node.js, you can use the getenv library.
For python, you can use the os module to do it for you.
You can not store it in HTML as it is served to the client.
Hoped this helped!

xfinnbar (211)

Do what RoBlockHead said.