Ask coding questions

← Back to all posts
Youtube API and .env stuff. And HTML stuff.
CookieSnowOwl (40)

I want to make a website... for a youtube channel...
I need to get the channel ID.
But I don't want anyone seeing it... obviously
So how do I use a .env file?
HTML question:
i have a <button>
and a var
so how do i make it so the var is in the button
i already made a innerHTML thing
but how do i implement?

Answered by MikeJMS8910 (107) [earned 5 cycles]
View Answer
Comments
hotnewtop
MikeJMS8910 (107)

Ok so for your first question, have you ever made discord bots and you know how you have to put the bot token in the .env file, id say do something similar. For your second I don't really know what you are saying but you can just do document.getElementById("buttonId").innerHTML = variable;

CookieSnowOwl (40)

ik how to put in the .env file, how do you access it like put the vars [email protected]

MikeJMS8910 (107)

@CookieSnowOwl const variable = process.env.variableName;
Please tell me if this helps

MikeJMS8910 (107)

@CookieSnowOwl ok no problem. if you can just press that check mark next to my name...

CookieSnowOwl (40)

there is a env thing in repl next to database now :)@MikeJMS8910