Blog
TUTORIAL

Sending Password Reset Notifications with Firebase and Courier

Sarah Barber

June 06, 2023

Header image for the Password Reset Notifications with Firebase using Courier tutorial

Table of contents

What is Firebase?

What is Courier?

Implementation — sending the password reset notification

Testing — verify that emails are getting sent

Conclusion

Setting up a password reset workflow inside your web application can be challenging. At a minimum, you need to build the logic to update the user’s password with a new hash, send the appropriate emails with the right content, and manage different user sessions across browsers.

If you’re responsible for managing password reset emails, it’s likely that you also have to manage all aspects of authentication and password management for your application. For those of us who are not security experts, it can be a much simpler and safer option to outsource this work to a system like Google Firebase.

Using Firebase with Courier gives the added advantage of full-featured notification infrastructure that integrates with your other product notifications and handles all the backend logic around delivery status, automation, template customization and management, internationalization, user preferences, email provider failover, analytics, and more.

This tutorial explains how to set up password reset notifications using Firebase and Courier. The examples are in Node.js, using the firebase-admin module and the Courier Node.js SDK; however, you should note that Courier provides SDKs for a number of different languages.

What is Firebase?

Firebase is a series of back-end cloud computing services for mobile app development, and the service we will be looking at here is Firebase Authentication. Firebase Authentication includes a built-in identity and access management system, and can help you implement a password reset workflow in no time.

Although Firebase Authentication allows you to send password reset emails, the email templates are limited when it comes to customization, and it doesn’t provide useful analytics about its notifications, such as which messages failed to send or how many were opened.

What is Courier?

Courier is a multi-channel notification service that allows developers to compose the entire notification experience across every available channel (email, SMS, Slack, MS Teams, push notifications, in-app notification inbox, etc). It provides a powerful REST API that can be integrated with any web or mobile application along with prebuilt UI components and a web studio to manage and customize notifications so they’re always on-brand and appropriate for the message-type and audience.

Implementation — sending the password reset notification

We will use Node.js to integrate Firebase with the Courier password reset workflow, using two packages:

  • firebase-admin: Provides server-side access to Firebase services. It allows developers to perform admin-related operations on all Firebase services accounts.
  • courier: Provides the module for using Node.js with Courier’s REST API, enabling access to Courier’s entire notification infrastructure and ability to work across any channel, including email, SMS, push, Slack and Courier’s full-featured web and mobile notification center that you can customize and drop into your app.

Step 1. Configure an email service provider in Courier

If you don’t have a Courier account, create one now.

Before you can send emails using Courier, you must configure an email service provider. In the Courier app, navigate to Channels and select your email service provider from the Provider Catalog. For this tutorial, we will be using Gmail.

reset-password-notification-with-firebase-8

Next, select Sign in with Google and give Courier access to your Google account. Now you have configured Gmail as an email provider.

Note that Courier does offer channel failover (eg. to SMS) or provider failover in the event that the primary email provider (in this case, Gmail) fails.

Step 2. Design your password reset notification template in Courier

In this step, you will create your email notification template, which you will use to send the password reset email.

Navigate to Designer in Courier, and click the Create Template button to create a new template. Name it Password reset. If you check the box Use AI to generate notification content, an email template will be generated for you, based on your notification name. Click Create Template again.

reset-password-notification-with-firebase-notification-create-template

You will now be asked to configure at least one notification channel. Select Email, and choose Gmail as the provider in the drop-down box. Click on the Email channel to begin writing your notification template, using Courier’s no-code editor. You can add variables to your template inside curly braces, which Courier highlights in green. Once you have created the content, click Publish Changes.

reset-password-notification-with-firebase-notification-add-channel

You can view your notification template ID by going to your notification's settings. You will need this later to refer to your notification template when sending notifications from your application.

reset-password-notification-with-firebase-notification-settings

Step 3. Create a project in Firebase

First, create a Firebase account and log in. Then, create a new Firebase project from the Firebase console.

reset-password-notification-with-firebase-7

After creating the project, you'll be redirected to the Project Overview page, where you can set up Firebase Authentication by clicking on the Authentication card.

Now you will want to add some users so you can manage them. First, you must set up a sign-in method — this could be Email/Password, social media accounts such as Facebook, or other authentication providers such as OpenID Connect. For this tutorial, choose Email/Password as your sign-in method.

reset-password-notification-with-firebase-2

Now it's time to create a new user, which will be used later to test your Courier-Firebase integration. You can add new users to the project in the Users tab. Make sure you add your own email address here, so that you can later check if the messages that Courier has sent have been received.

reset-password-notification-with-firebase-4

Step 4. Create a Node.js project

First, install Node.js and npm. Then, create a directory for your Node project, and add a single file called index.js inside the directory. Use npm to install the firebase-admin Node module for interacting with Firebase, and the Courier Node module for interacting with Courier:

Copied!

npm i firebase-admin @trycourier/courier

Step 5. Connect to Firebase using Firebase Admin

The file index.js is where you’ll write your code. You will need to first import the Firebase Admin package, and then initialize your Firebase app. To initialize your app, pass some configuration details to Firebase Admin, including the name of the project in Firebase that you are initializing, as well as some extra details like your private key. It is simplest to store all your Firebase authentication details as configuration in a JSON file; the details of how to do this are explained fully in the Firebase Admin documentation. Create a file called serviceAccountKey.json and paste in the JSON generated by Firebase, and then reference this file when initializing your Firebase app:

Copied!

const firebaseAdminServiceAccount = require("./serviceAccountKey.json");
const firebaseAdmin = require('firebase-admin');
firebaseAdmin.initializeApp({
credential: firebaseAdmin.credential.cert(firebaseAdminServiceAccount)
});

Step 6. Connect to the Courier SDK

Add this code snippet to your index.js file to connect to Courier:

Copied!

const { CourierClient } = require("@trycourier/courier");
const courier = CourierClient({ authorizationToken: "<YOUR_COURIER_API_KEY>" });

You must replace <YOUR_COURIER_API_KEY> with your actual Courier API key. This can be found in the Courier app by going to Settings -> API keys: reset-password-notification-with-firebase-3

Use Firebase Admin to generate the password reset link. Once this is generated, pass it to a function sendResetEmail (which you will define in step 8) to take care of sending the email:

Copied!

firebaseAdmin.auth().generatePasswordResetLink(email)
.then(async (link) => {
return await sendResetEmail(email, name, JSON.stringify(link), companyName)
})
.catch((error) => {
console.log('Error fetching user data:', error);
});

Step 8: Send the password reset email

You need to fill in the sendResetEmail function so that it actually sends the email. This function will use the Courier SDK to get Courier to handle the sending:

Copied!

const sendResetEmail = async (email, name, link, companyName) => {
return await courier.send({
message: {
template: "<NOTIFICATION_TEMPLATE_ID>",
to: {
email: email
},
routing: {
method: "single",
channels: ["email"]
},
data: {
userName: name,
passwordResetLink: link,
companyName:companyName
}
},
});
}

You’ll need to replace the <NOTIFICATION_TEMPLATE_ID> with the ID of your notification template. To do this, navigate to your password reset notification template, go to the notification template settings, and copy the Notification ID.

reset-password-notification-with-firebase-10

Full code example

Below is a working example of some code that calls Firebase and Courier to get the password reset link and send the email. Simply paste this into your index.js file.

Copied!

const firebaseAdmin = require('firebase-admin');
const firebaseAdminServiceAccount = require("./serviceAccountKey.json");
const { CourierClient } = require("@trycourier/courier");
const courier = CourierClient({ authorizationToken: "<COURIER_AUTH_TOKEN>" });
const email = 'someone@email.com';
const name = 'John Doe';
const companyName = 'Acme';
firebaseAdmin.initializeApp({
credential: firebaseAdmin.credential.cert(firebaseAdminServiceAccount)
});
firebaseAdmin.auth().generatePasswordResetLink(email)
.then(async (link) => {
return await sendResetEmail(email, name, JSON.stringify(link), companyName)
})
.catch((error) => {
console.log('Error fetching user data:', error);
});
const sendResetEmail = async (email, name, link, companyName) => {
return await courier.send({
message: {
template: "<NOTIFICATION_TEMPLATE_ID>",
to: {
email: email
},
routing: {
method: "single",
channels: ["email"]
},
data: {
userName: name,
passwordResetLink: link,
companyName:companyName
}
},
});
}

Testing — verify that emails are getting sent

Testing this code is simple. All you need to do is enter the correct values for the placeholders <COURIER_AUTH_TOKEN> and <NOTIFICATION_TEMPLATE_ID>, enter your own values for variables in the data object, such as name ,link and companyName, and replace email with your own email address.

Now, run node index.jsto run your code, and then check your email. You should receive an email that looks something like this: reset-password-notification-with-firebase-1

Conclusion

Integrating Firebase Authentication with Courier for sending password reset notifications provides a robust and convenient solution and it’s only scratching the surface of what’s possible with Courier. This gets you started with the foundation for sending password reset emails to your users, but please reach out to Courier if this is part of a larger infrastructure project around notifications that we can help you think through.

Firebase Authentication offers the functionality to send password reset emails, but it’s not designed to deliver the core functionality required for a production use case. By integrating Courier, you can leverage its extensive feature set with things like template customization, internationalization, provider failover, automation across channels, user preferences, and delivery analytics (such as delivery failures and open rates). Using Courier means you can manage all email templates in one centralized platform.

Overall, the combination of Firebase and Courier offers a powerful solution for managing password reset notifications, simplifying the development process, and enhancing the user experience. Please contact us if you want to further discuss your project and unique requirements.

Similar resources

transactional vs. marketing vs. product notifications
GuideTutorialNotifications Landscape

Transactional, Product, and Marketing Notifications: What Are the Differences?

Understanding the difference between transactional, product, and marketing notifications is essential for developers building notification infrastructure. Transactional notifications confirm user actions and require no opt-in. Product notifications drive feature adoption through education. Marketing notifications promote sales and require explicit consent. This guide explains the legal requirements, best practices, and when to use each notification type to build compliant systems users trust.Retry

By Kyle Seyler

October 23, 2025

Video Tutorial Toasts SDK
Tutorial

How to Add Toast Notifications with the New Courier Toasts SDK

Learn how to add real-time, customizable toast notifications to your app with the Courier Toasts SDK. This quick tutorial shows how to integrate toasts using Web Components or React and sync them with your notification center for a seamless, modern UX.

By Dana Silver

October 20, 2025

Twilio Messaging API
TutorialIntegrationsEngineeringProduct Management

What is the Twilio Messaging API?

Twilio's Messaging API enables developers to send and receive SMS, MMS, WhatsApp, and RCS messages at scale across 180+ countries. While Twilio excels at reliable message delivery through carrier networks, modern applications need more than single-channel messaging. Courier acts as a provider-agnostic orchestration layer that activates messaging across Twilio and other channels from a single platform. You get intelligent routing, user preference management, and fallback logic without vendor lock-in.

By Kyle Seyler

October 03, 2025

Multichannel Notifications Platform for SaaS

Products

Platform

Integrations

Customers

Blog

API Status

Subprocessors


© 2025 Courier. All rights reserved.