Setup Firebase Token as An Environment Variable in Postman

Setup Firebase Token as An Environment Variable in Postman

Postman’s environment variables

In most of my projects, I use Postman to check that my API works fine. Most of them, uses Firebase to authenticate the user, so I need to retrieve the Session Token that Firebase provides, an attach it to the header of each response.

If you do this manually, for just a couple of endpoints will be alright, but if you have a lot of endpoints to attach this token to the header, you will require a lot of time.

A solution for this problem is an environment variable for the Firebase Token. So let’s configure it:

First, we need to create an environment, so in Postman, click the button inside the white circle that is presented in the next image:

Image for post

Then, click in the Add button. There you need to name the Environment and create the variables that you want to use. For this example we will create two variables, host and token:

Image for post

testing api firebase postman

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Do API Testing?

API endpoint when you send the get request to that URL it returns the JSON response. In this article, I am going to use postman assertions for all the examples since it is the most popular tool. But this article is not intended only for the postman tool.

Top 10 Best Tips for API Testing - API Testing Tips

In this article, we'll go over 10 Tips for approaching API Testing with microservices. Find out more! Top 10 Best Tips for API Testing - API Testing Tips

Public ASX100 APIs: The Essential List

The method used for this initial research was to obtain a list of the ASX100 (as of 18 September 2020). Then work through each company looking at the following

Top 10 API Security Threats Every API Team Should Know

Learn what are the most important API security threats engineering leaders should be aware of and steps you can take to prevent them

Postman for API Testing — Pros, Cons, and Alternative Solutions

Postman API testing helps Testers stay pledged to short cycles release and update frequently. Check out three practices and advanced API testing. Let's dive into Postman for API Testing — Pros, Cons, and Alternative Solutions