FcmProvider implements PushTransport via the FCM HTTP v1 API.
FcmProvider
PushTransport
Authenticates with a short-lived OAuth2 bearer token minted from a service account (see FcmTokenSource), replacing the legacy serverKey API that Google decommissioned in 2024.
FcmTokenSource
serverKey
const provider = new FcmProvider({ projectId: 'my-firebase-project', clientEmail: 'fcm@my-project.iam.gserviceaccount.com', privateKey: config.get('FCM_PRIVATE_KEY'), runtime,});await provider.send({ to: deviceToken, title: 'Hello', body: 'World' }); Copy
const provider = new FcmProvider({ projectId: 'my-firebase-project', clientEmail: 'fcm@my-project.iam.gserviceaccount.com', privateKey: config.get('FCM_PRIVATE_KEY'), runtime,});await provider.send({ to: deviceToken, title: 'Hello', body: 'World' });
0.1.0
Creates an FcmProvider.
Provider configuration
If projectId is missing, or — when no tokenSource is supplied — if clientEmail, privateKey, or runtime is missing
projectId
tokenSource
clientEmail
privateKey
runtime
Sends a push notification via the FCM HTTP v1 endpoint.
The push notification message
If a token cannot be obtained, or the response is not OK
FcmProviderimplementsPushTransportvia the FCM HTTP v1 API.Authenticates with a short-lived OAuth2 bearer token minted from a service account (see
FcmTokenSource), replacing the legacyserverKeyAPI that Google decommissioned in 2024.Example
Since
0.1.0