Reference

Push options

Fields accepted by `PushSender.send` for Web Push and FCM.

PushOptions is WebPushOptions | FcmPushOptions. Pick the shape that matches your transport.

The one rule

Pass subscription to WebPushTransport and token to FcmTransport.

Shared fields

FieldTypeRequired
titlestringyes
bodystringyes
dataRecord<string, unknown>no
iconstringno
ttlnumberno
messageIdstringno

Web Push

FieldTypeRequired
subscriptionPushSubscriptionyes

A subscription contains endpoint, keys.p256dh, and keys.auth.

FCM

FieldTypeRequired
tokenstringyes
imagestringno

FCM stringifies non-string data values before send.

Result

FieldTypeNotes
messageIdstringProvider or client id
statusstringe.g. "accepted"
responsestringOften the HTTP status or FCM name
providerstring?"webpush" / "fcm"; set by fallback
providerIndexnumber?Fallback chain index

Map any channel result with channel send result.

Next

On this page