Skip to content

Instantly share code, notes, and snippets.

View devvspaces's full-sized avatar
👩‍💻
Blockchain and Web3

0xBytechain devvspaces

👩‍💻
Blockchain and Web3
  • ByteChain
  • Nigeria
View GitHub Profile
@devvspaces
devvspaces / gist:fe283208d4dbd1ab97dfc0e6e0bdea4c
Created August 4, 2026 21:02
Make firebase admin work with nestjs
import { App, initializeApp, cert, getApps } from 'firebase-admin/app';
import { getMessaging, Message } from 'firebase-admin/messaging';
import { ServiceAccount } from 'firebase-admin';
// Ensure gaxios (used by firebase-admin & google-auth-library) uses Node native fetch
function patchGaxiosClass(Gaxios: any) {
if (Gaxios && !(Gaxios.prototype as any).__fetchPatched) {
(Gaxios.prototype as any).__fetchPatched = true;
const originalRequest = Gaxios.prototype.request;
Gaxios.prototype.request = function (opts: any) {