---
title: "Firebase Cloud Messaging v1 Now Available from the Admin SDK"
description: "Firebase Cloud Messaging v1 Now Available from the Admin SDK"
published: "2018-02-19"
last_updated: "2018-02-19"
authors:
  - "Jen Person (Developer Relations Engineer)"
categories:
  - "Cloud Messaging"
  - "Admin SDK"
  - "Launch"
canonical_url: "https://firebase.blog/posts/2018/02/firebase-cloud-messaging-v1-now"
---

# Firebase Cloud Messaging v1 Now Available from the Admin SDK

*Published February 19, 2018 by Jen Person (Developer Relations Engineer)*

---
I'm always amazed when I think about the fact that [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/) sends **billions of messages a day**. Developers on iOS, Android, and web rely on FCM to send notifications and data messages to their clients. We recently updated FCM to incorporate better security and new features, and now you can access the new FCM through the Firebase Admin SDK for Node.js, Python, Java, and Go.

The latest version of FCM, called FCM v1, includes the ability to send a single request with platform-specific overrides. For example, you can set a time to live for an Android notification and an APNs priority for an iOS notification in the same body. See [the documentation](https://firebase.google.com/docs/cloud-messaging/concept-options#customizing_a_message_across_platforms) or [this blog post](https://firebase.googleblog.com/2017/11/whats-new-with-fcm-customizing-messages.html) for more information on platform overrides.

You can now conveniently integrate your server-side applications with the FCM v1 API using the Firebase Admin SDKs. Here's how you can send a simple data message in Node.js:

```js
const registrationToken = 'YOUR_REGISTRATION_TOKEN';

const message = {
  data: {
    score: '850',
    time: '2:45'
  },
  token: registrationToken
};

admin.messaging().send(message)
  .then((response) => {
    console.log('Successfully sent message:', response);
  })
  .catch((error) => {
    console.log('Error sending message:', error);
  });
```

To see this code in Java, Python, and Go, check the [documentation](https://firebase.google.com/docs/cloud-messaging/admin/send-messages). To see all message payload options, check out the [FCM v1 documentation](https://firebase.google.com/docs/cloud-messaging/admin/send-messages). In addition to sending messages to devices and topics, the Admin SDK for FCM also allows you to manage topic subscriptions from your server.

Here's an example of subscribing to a topic in Node.js:

```js
var registrationTokens = [
  'YOUR_REGISTRATION_TOKEN_1',
  // ...
  'YOUR_REGISTRATION_TOKEN_n'
];
admin.messaging().subscribeToTopic(registrationTokens, topic)
  .then(function(response) {
    console.log('Successfully subscribed to topic:', response);
  })
  .catch(function(error) {
    console.log('Error subscribing to topic:', error);
  });
```

To see this code in Java, Python, and Go, check [the documentation](https://firebase.google.com/docs/cloud-messaging/admin/manage-topic-subscriptions). Thanks to the Admin SDK, it's even easier than ever to send messages! Check out the full documentation [here](https://firebase.google.com/docs/cloud-messaging/admin/). And if you build something cool with FCM, be sure to tell us about it! Tweet @Firebase and @ThatJenPerson and let us know how it's going!

*   [Admin SDK Documentation for FCM](https://firebase.google.com/docs/cloud-messaging/admin/)
*   [FCM v1 message REST resource](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages)
*   [FCM Platform Overrides Documentation](https://firebase.google.com/docs/cloud-messaging/concept-options#customizing_a_message_across_platforms)
*   [What's new with FCM? Customizing messages across platforms! - blog post](https://firebase.googleblog.com/2017/11/whats-new-with-fcm-customizing-messages.html)
*   [Managing Subscriptions using the Admin SDK](https://firebase.google.com/docs/cloud-messaging/admin/manage-topic-subscriptions)
