Demo · Firebase Cloud Messaging
Orbit Files
A pretend file-sharing service, built to show how a real site signs a user in and binds their Firebase device token to their account in Moonsender.
Setup required
This demo is deployed but not configured. Set the values below in
src/.env.demo2 and redeploy. Accounts still work meanwhile — you can register
and log in, there is just nothing to bind a token to yet.
Where these come from
FIREBASE_*-
Firebase console → Project settings → General → Your apps → Web app config.
FIREBASE_VAPID_KEYis under Cloud Messaging → Web Push certificates — 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. A native project will not work here.
MOONSENDER_API_KEY-
An API key with
audience,push:writeandsend:push. It stays server-side.
What happens when you sign up
-
PUT /api/v1/audience/customers/{email}a Moonsender customer is upserted — this must happen first, because binding resolves an existing customer and will not create one -
getToken()(Firebase SDK) Google mints a registration token for this browser. Unlike the native demo there is no Moonsender subscribe step — a firebase project has no public one -
POST /api/v1/push/subscriptions/bindthis site's backend registers the raw token under the firebase project and attaches it to your customer, using its API key -
POST /api/v1/send/push/customa test notification, addressed to the customer rather than the device
Create an account
Already registered
Accounts live in memory and vanish when the container restarts. Use a throwaway password — this is a demo, not a service.