Image for post
Image for post

As developers we often come across situations where we’d like to see all the remote API calls made by a certain application. This requirement often comes up during development and testing, but there are times when you might want to see this information for production applications too.

In this article we explore a couple of simple tricks for logging the HTTP requests made by applications written in Node.js or Python. These techniques do not require any specific logging framework, and can be managed entirely within the application code without too much effort. …


Image for post
Image for post

Firebase Admin SDK contains APIs for fetching and deleting individual user accounts. These APIs enable developers to fetch Firebase Auth user accounts by their uid, email or phone number, or delete a selected user account by its uid. Developers have been using these APIs to implement tools, automation scripts and even Cloud Functions that perform complex user management tasks. Listing 1 shows a Node.js script that uses the Admin SDK to fetch a user account by email address, and delete it.

Listing 1: Fetching and deleting a single user account

While these APIs are useful in a wide range of use cases, sometimes we need to implement even more powerful backend applications that deal with multiple user accounts at once. As a developer you may wish to fetch several user accounts as a batch, and perform some administrative operations on them. Or you may have been running some experiments with Firebase that created a bunch of test accounts, and now you wish to delete all of them. …


Image for post
Image for post

Cloud Firestore is Google’s highly scalable, NoSQL database for mobile and web applications. On top of a document-oriented data model, Firestore offers an array of powerful features including realtime event listeners, atomic transactions, and offline support.

Just because it is another NoSQL database, many developers assume that you cannot enforce any integrity constraints on Firestore data. …


Image for post
Image for post

Google Cloud Identity Platform (GCIP) allows you to add Google-grade identity and access management support to your own applications. Enterprises can use GCIP to manage the identities of their employees, customers, partners and IoT devices at scale. In November 2019 Google further extended GCIP with support for tenant management. This new feature enables enterprises to define multiple tenants within a single instance of GCIP. Each user account can be assigned to a tenant, and authenticated using a collection of tenant-specific identity providers.

As an example consider an automobile manufacturer who’s partnered with at least two distributors. The manufacturer offers an array of online inventory management, order processing and payment applications to the distributors. However, as often is the case, the distributors use different SAML identity providers to manage the identities of their own employees and systems. …


Image for post
Image for post

Recently I was reading Patrick Martin’s article on deploying a C# backend in Google Cloud Run, and I figured it would be fun to write a follow up piece featuring the Firebase Admin SDK for .NET. Hence, in this post I show how to implement a custom authentication service in C#, and deploy it as a serverless API using Cloud Run. This service validates user credentials, and uses the Admin SDK to generate signed custom tokens that clients can use to sign into Firebase.

Google Cloud Run is one of the latest additions to Google’s serverless portfolio. It enables developers to deploy any Docker container as a serverless application in the cloud. This means you no longer have to code your serverless apps using a specific set of programming languages or APIs. …


Image for post
Image for post

Does this look familiar?

Your new account has been created.

To confirm your email and activate your account, please click the below link:

https://www.fancy.new.service/0bscureC0nf1rmat10nL1nk

If the above link does not work, please copy and paste the link on your web browser.

We’ve all received emails of this nature from various online services. …


Image for post
Image for post

Since the Firebase Cloud Messaging (FCM) support became available across all flavors of the Admin SDK, many developers have been requesting for an API that enables sending messages to more than one recipient. The original FCM API, which is demonstrated in listing 1, facilitates sending messages to individual devices by addressing each message to a single device registration token.

Listing 1: Sending a message to a single device

But developers often come across scenarios where a certain message needs to be sent to multiple devices. I myself ran into this use case when I was working on my cryptocurrency price monitor app. My server-side code that watches for cryptocurrency price updates has to notify users of the price changes, and often it has to notify multiple users. …


Image for post
Image for post

The Go runtime for Google Cloud Functions was released into beta this month. I’m a huge fan of statically typed languages, and of Golang in particular. Therefore I’m excited about the possibility of developing serverless functions in Go, and deploying them on the Google Cloud Platform (GCP). In this post we look at how to implement a Cloud Function in Go, and set it up to be called from a Cloud Firestore trigger. Then we are going to make things more interesting by throwing the Firebase Realtime Database also into the mix.

Our use case is pretty simple. Suppose we have a movie reviews app. Users post reviews, which are stored in a Firestore collection named movie_reviews. Whenever a new review is posted, we want to analyze it, score the content, and award the author of the review some points. Total scores of users are kept up-to-date in the Firebase Realtime Database. We can certainly implement this use case with just Firestore. But I’m also using the Realtime Database to demonstrate integrating multiple services in the Firebase ecosystem via Cloud Functions. Also I want to try the Firebase Admin SDK in the new Cloud Functions runtime. …


Image for post
Image for post

In this article I demonstrate how to build a cryptocurrency price monitoring app using Firebase and Google Cloud Platform (GCP). The app receives notifications whenever the price of Bitcoin or Ethereum change in the market. Users can configure minimum and maximum price thresholds for each cryptocurrency, and we use these settings to determine which users to notify for any given price change.

The inspiration for this app came from an article published by the Pusher community (read part 1 and part 2 here). Their cryptocurrency price alerts app uses Pusher for delivering notifications, which seems to be using Firebase Cloud Messaging (FCM) under the hood. Furthermore they employ a SQLite database and a standalone back-end server developed in Go to implement the necessary functionality. …


Image for post
Image for post

Enterprise developers often have to deploy their applications behind a corporate HTTP proxy in order to meet various security and IT compliance requirements. …

About

Hiranya Jayathilaka

Software engineer at Google. Enjoys working at the intersection of cloud, mobile and programming languages. Fan of all things tech and open source.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store