• Version 0.6.1
  • Published
  • 4.65 kB
  • No dependencies
  • Apache-2.0 license


npm i @firebase/messaging-types
yarn add @firebase/messaging-types
pnpm add @firebase/messaging-types


@firebase/messaging Types



interface FcmOptions

interface FcmOptions {}

    property analyticsLabel

    analyticsLabel?: string;
      link?: string;

        interface FirebaseMessaging

        interface FirebaseMessaging {}

          method deleteToken

          deleteToken: { (): Promise<boolean>; (token: string): Promise<boolean> };
          • window controller

          • Deprecated

          method getToken

          getToken: (options?: {
          vapidKey?: string;
          serviceWorkerRegistration?: ServiceWorkerRegistration;
          }) => Promise<string>;

            method onBackgroundMessage

            onBackgroundMessage: (
            nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload>,
            error?: ErrorFn,
            completed?: CompleteFn
            ) => Unsubscribe;
            • service worker controller

            method onMessage

            onMessage: (
            nextOrObserver: NextFn<any> | Observer<any>,
            error?: ErrorFn,
            completed?: CompleteFn
            ) => Unsubscribe;

              method onTokenRefresh

              onTokenRefresh: (
              nextOrObserver: NextFn<any> | Observer<any>,
              error?: ErrorFn,
              completed?: CompleteFn
              ) => Unsubscribe;

                method requestPermission

                requestPermission: () => Promise<void>;
                • Deprecated

                  Use Notification.requestPermission() instead. https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission

                method setBackgroundMessageHandler

                setBackgroundMessageHandler: (
                callback: (payload: any) => Promise<any> | void
                ) => void;

                  method usePublicVapidKey

                  usePublicVapidKey: (b64PublicKey: string) => void;

                    method useServiceWorker

                    useServiceWorker: (registration: ServiceWorkerRegistration) => void;

                      interface MessagePayload

                      interface MessagePayload {}

                        property collapseKey

                        collapseKey: string;

                          property data

                          data?: { [key: string]: string };

                            property fcmOptions

                            fcmOptions?: FcmOptions;

                              property from

                              from: string;

                                property messageId

                                messageId: string;

                                  property notification

                                  notification?: NotificationPayload;

                                    interface NotificationPayload

                                    interface NotificationPayload {}

                                      property body

                                      body?: string;

                                        property image

                                        image?: string;

                                          property title

                                          title?: string;

                                            Type Aliases

                                            type FirebaseMessagingName

                                            type FirebaseMessagingName = 'messaging-compat';

                                              Package Files (1)

                                              Dependencies (0)

                                              No dependencies.

                                              Dev Dependencies (1)

                                              Peer Dependencies (1)


                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@firebase/messaging-types.

                                              • Markdown
                                              • HTML
                                                <a href="https://www.jsdocs.io/package/@firebase/messaging-types"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>