How to Secure API token

Search for a command to run...

No comments yet. Be the first to comment.
I strongly believe, 20’s are all about experiments I mean 20 - 30 Age is to try out all the things you like and try to succeed, After that you can think about settling down on one career or one company. TL;DR → I am leaving my Full Stack Developer J...

First things first, Start your IT career with growing company or startup. I started as Full Stack Developer at Keka HR. Its been one whole year and it feels like i joined yesterday. However, knowledge gap and solution providing strategies improvised ...

I know it’s been rough year for all of us, but as Developer who followed the bandwagon so called Data Science in college, ended up falling in love with Web Development after getting job in it, which i never thought, i would do. I wanna share my 2021 ...

Balancing, most people refer it as theory where if we manage to satisfy the couple of things / persons / activities we want to do. But its easier said than done, Cause i am facing this issue in recent times and i came over it with some small tweaks i...

No matter how well you are at Coding. Name Conventions can be a pain in the A**. In the programming world, languages use some specific pattern in naming variables, functions And Jeff Atwood (Stack Overflow Co-founder ) says “Naming Conventions is...

If you are into this tech world for a while. I’m sure you heard about the word API. API is the Application Program Interface. For example, Google has API which gives user details access to third party software. So basically API acts as a bridge to pass secure information to authenticate third-party software. To authenticate this third parties API token is required.
Many contributors use this API tokens to create some unique products like creating Telegram Bot, Slack Bot. Although the product was built successfully. Contributors can get organized by showing their code. To do that they need to secure the API token before they publish it to GitHub.
Different ways of Securing API:
To secure API token you need to define them in the environment variables.
Environment Variables you will find Edit the Environment variables, open it. you will find these
2. Then go to Environment Variables. Click on the New button then add the API token with some variable name and note the variable name

3. After adding this Variable then Restart it.
Now you can use this API token across any code in your local system.

2. Then open Secrets on the left side as shown in the above picture.
3. Then add new Secret with Var name and API token.
4. Now this variable works across the Repo.
And Secret Variable won't disclose to any other users or third parties by GitHub.
In Heroku, you can do this in two ways either through Heroku CLI or Dashboard.
Heroku loginheroku config:set S3_KEY=8N029N81 S3_SECRET=9s83109d3+583493190
Now you can use variable name anywhere in the Project

This is it. Hope this post is helpful to you!
If you like my post like it, Share it and if you have a doubt comment down below 👇