Firebase push demo
Registers this browser with Firebase Cloud Messaging and binds the resulting token to a Moonsender customer.
Setup required
This demo is deployed but not configured. Set the values below in
src/.env.demo2 and redeploy.
Where these come from
FIREBASE_*-
Firebase console → Project settings → General → Your apps → Web app config.
FIREBASE_VAPID_KEYis under Cloud Messaging → Web Push certificates — this is Firebase's own key pair, not the one a Moonsender native project owns. MOONSENDER_PUSH_PROJECT- The slug of a Moonsender push project of type firebase (Channels → Push → Create). A native project will not work here.
MOONSENDER_API_KEY- An API key with the
push:writescope. It stays server-side.
-
1. Register this browser
Asks for notification permission and requests an FCM registration token.
-
2. Bind the token to a customer
Sends the token to this demo's backend, which calls Moonsender's authenticated bind endpoint. The API key never reaches your browser.
-
3. Send a push
Trigger a send from the Moonsender UI against the same push project. Sending is not part of this demo.
FCM registration token
not registered yet