AbsoluteJS

@absolutejs/dispatch-fcm

@absolutejs/dispatch-fcmv0.2.0betaMessaging

Firebase Cloud Messaging HTTP v1 PushAdapter for @absolutejs/dispatch with ADC and short-lived OAuth token support.

#Installation

BASH
bun add @absolutejs/dispatch-fcm

#Capabilities

Overview

Firebase Cloud Messaging HTTP v1 PushAdapter for @absolutejs/dispatch. It uses google-auth-library Application Default Credentials by default, so access tokens remain short-lived and service-account keys do not enter message payloads or dispatch core.

Use /topics/name or metadata.targetType: 'topic' for a topic. FCM data values are normalized to strings as required by HTTP v1. Advanced android, apns, and webpush objects can be supplied in message metadata.

Outcomes

What you can build

Build on the supported package contract

Use @absolutejs/dispatch-fcm through its supported public entry points.

Hardening checklist

Production guidance

Make every external boundary explicitPin the deployed @absolutejs/dispatch-fcm version, replace example or memory-backed dependencies with durable implementations, bound external calls, protect credentials, and emit enough evidence to retry or recover safely.

Follow in order

Troubleshooting path

1
Trace from the first failed boundary
Reproduce the smallest canonical @absolutejs/dispatch-fcm example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#@absolutejs/dispatch-fcm quick start

Partial snippet

# @absolutejs/dispatch-fcm

TS
import { createDispatcher } from "@absolutejs/dispatch";
import { createFcmAdapter } from "@absolutejs/dispatch-fcm";

const dispatcher = createDispatcher({
  push: createFcmAdapter({ projectId: process.env.FCM_PROJECT_ID! }),
});

#Public entry points

Supported entry points declared by this package manifest.

Package entry point declared in package.json.

@absolutejs/dispatch-fcm@absolutejs/dispatch-fcm/manifest@absolutejs/dispatch-fcm/manifest.json

#Package commands

Scripts declared by this package manifest.

bun run buildrm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --sourcemap --target=bun --external @absolutejs/dispatch --external '@absolutejs/dispatch/*' --external @absolutejs/manifest --external @sinclair/typebox --external google-auth-library --external 'google-auth-library/*' && tsc --project tsconfig.build.json && absolute-manifest emit
bun run check:packagebun run format && bun run typecheck && bun run test && bun run verify-package && bun run build && bun run verify-package --artifacts
bun run formatprettier --write "./**/*.{ts,json,md}"
bun run testbun test
bun run typechecktsc --noEmit

#API reference

Search the declarations exported by the current package type files. Expand a symbol to inspect its source-backed signature.

6 symbols
FcmFetchtypePermalinkSource
TS
type FcmFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
Exported from @absolutejs/dispatch-fcm