Home/Notifications/Firebase Cloud Messaging
Notifications
firebase-fcm

Firebase Cloud Messaging

Push NotificationsMobileWeb PushGoogleFree

Google's free cross-platform push notification service. Supports iOS, Android, and web push notifications. Completely free with no monthly limits — ideal when you need reliable push without third-party costs.

License

Proprietary (Google)

Language

TypeScript / Python

44
Trust
Limited

Why Firebase Cloud Messaging?

Mobile app (iOS/Android) push notifications at zero cost

Already using Firebase/Google Cloud — FCM is natively integrated

Web push alongside mobile push from a single API

Signal Breakdown

What drives the Trust Score

Weekly npm downloads
1.8M/wk (firebase-admin)
GitHub commits (90d)
200
GitHub stars
2.9k (admin)
Stack Overflow questions
55k
Community health
Mature
Weighted Trust Score44 / 100

Download Trend

Last 12 months

Tradeoffs & Caveats

Know before you commit

Need rich multi-channel messaging (email, SMS, in-app) — OneSignal or Novu are all-in-one

No Google vendor lock-in policy — FCM ties you to Google infrastructure

Need advanced segmentation/analytics on notifications — Braze or OneSignal are more capable

Pricing

Free tier & paid plans

Free tier

Completely free — no limits on FCM messages

Paid

N/A

FCM itself is free; Firebase platform has quotas for other services

Alternative Tools

Other options worth considering

novu
Novu79Good

Open-source notification infrastructure for developers. Unify in-app, email, SMS, push, and Slack notifications with a single API, workflow engine, and self-hostable dashboard.

onesignal
OneSignal31Limited

All-in-one customer messaging platform for push notifications, in-app messages, email, and SMS. Industry-leading free web push tier makes it the go-to for early-stage products.

Often Used Together

Complementary tools that pair well with Firebase Cloud Messaging

nextjs

Next.js

Frontend & UI

98Excellent
View
supabase

Supabase

Database & Cache

95Excellent
View
onesignal

OneSignal

Notifications

31Limited
View
novu

Novu

Notifications

79Good
View
clerk

Clerk

Auth & Users

80Strong
View

Learning Resources

Docs, videos, tutorials, and courses

Get Started

Repository and installation options

View on GitHub

github.com/firebase/firebase-admin-node

npmnpm install firebase-admin
pippip install firebase-admin

Quick Start

Copy and adapt to get going fast

import { initializeApp, cert } from 'firebase-admin/app';
import { getMessaging, Message } from 'firebase-admin/messaging';

initializeApp({ credential: cert(JSON.parse(process.env.FIREBASE_SERVICE_ACCOUNT!)) });

const messaging = getMessaging();

async function sendToTopic(topic: string, title: string, body: string) {
  const message: Message = {
    notification: { title, body },
    topic,
  };
  return messaging.send(message);
}

await sendToTopic('news', 'Breaking news', 'Check the latest updates!');

Code Examples

Common usage patterns

Send to multiple devices

Batch-send notifications to up to 500 device tokens

import { getMessaging, MulticastMessage } from 'firebase-admin/messaging';

const messaging = getMessaging();

const message: MulticastMessage = {
  notification: {
    title: 'Flash Sale!',
    body: '50% off all items for the next 2 hours',
    imageUrl: 'https://example.com/sale-banner.jpg',
  },
  data: {
    saleId: 'FLASH_50',
    expiresAt: new Date(Date.now() + 2 * 60 * 60 * 1000).toISOString(),
  },
  tokens: deviceTokens, // array of FCM tokens (max 500)
};

const response = await messaging.sendEachForMulticast(message);
console.log(`${response.successCount} sent, ${response.failureCount} failed`);

Topic-based broadcast

Subscribe users to topics and broadcast messages

import { getMessaging } from 'firebase-admin/messaging';

const messaging = getMessaging();

// Subscribe a device to a topic
await messaging.subscribeToTopic(['user_device_token'], 'sports-news');

// Send to all subscribers of the topic
await messaging.send({
  notification: {
    title: 'Goal!',
    body: 'Your team just scored!',
  },
  topic: 'sports-news',
});

Community Notes

Real experiences from developers who've used this tool