user3377364
user3377364

Reputation: 181

How can I hide my API key from other contributors on my GitHub repo (Nextjs)

Is it possible to hide the API key while at the same time allowing other contributors to use it while in development?

I'm using Nextjs

Upvotes: 0

Views: 180

Answers (1)

Aditya Kumar
Aditya Kumar

Reputation: 1

We can hide our api_key inside .env file.

inside .env

USER_ID=239482`

getting api key insde other file

process.env.USER_ID; //239482

you can also read form here https://nodejs.dev/en/learn/how-to-read-environment-variables-from-nodejs/

Upvotes: 0

Related Questions