Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] YouTube API key exposed in public repository #16

Open
Petsamuel opened this issue Oct 4, 2023 · 4 comments
Open

[BUG] YouTube API key exposed in public repository #16

Petsamuel opened this issue Oct 4, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@Petsamuel
Copy link
Contributor

Petsamuel commented Oct 4, 2023

Important !!!

I am writing to inform you that your YouTube API key is exposed in your public repository.

This is a security risk, as anyone who has access to the repository could also access your YouTube account.
I recommend that you immediately remove the API key from the repository and reset it.

Thank you for your time and attention to this matter.

@Petsamuel Petsamuel added the bug Something isn't working label Oct 4, 2023
@anand346
Copy link
Owner

anand346 commented Oct 5, 2023

Hi @Petsamuel, is there any other way to fetch youtube videos on runtime without exposing the youtube API key?

@Petsamuel
Copy link
Contributor Author

For development - Yes, by creating using a dotenv on your local machine.

For production you can just upload it to vercel environment in the settings

@anand346
Copy link
Owner

anand346 commented Oct 6, 2023

yeah we can use .env file but we will need to use the NEXT_PUBLIC_ prefix for the Youtube API key environment variable so that it can be used in the browser.. other wise the API key cannot be used to fetch issues. And if the API key is exposing in browser then it means it is not secret anymore...

Do you any other approach so that we can fetch issues using the API key in the browser and at the same time it cannot be exposed. Your suggestion will be highly appreciated.

@Petsamuel
Copy link
Contributor Author

There are different methods .... Here is a way for production ..!2023_10_06_09_29_47.jpg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants