Blog

How to Integrate Firebase with Bubble

Sep 20, 2025

Calculating...

Calculating...

Harish Malhi - founder of Goodspeed

Founder of Goodspeed

How to Integrate Firebase with Bubble – Goodspeed Studio blog

Learn how to integrate Firebase with Bubble to add real-time database syncing, push notifications, and cloud file storage to your no-code application.

Learn how to integrate Firebase with Bubble to add real-time database syncing, push notifications, and cloud file storage to your no-code application.

Why Firebase When You Already Have Bubble?

Bubble has its own database, file storage, and backend logic. Firebase duplicates some of that. So the question isn't whether Firebase replaces Bubble — it doesn't. The question is what Firebase does that Bubble can't do natively. The answer comes down to three things: real-time data syncing, push notifications for mobile, and high-performance file delivery through Cloud Storage with a global CDN.

Bubble's database works on a request-response model. You load a page, it fetches data, it displays. If the data changes, the page doesn't update until the user refreshes or you build polling logic. Firebase's Realtime Database and Firestore push updates to connected clients instantly. For chat apps, live dashboards, collaborative editors, or anything where multiple users see the same data change simultaneously, Firebase fills a gap Bubble can't fill natively.

What You Can Actually Build

The most practical use case is real-time messaging. If you're building a customer support tool, team chat, or in-app messaging feature in Bubble, Firebase Realtime Database handles the message delivery with sub-second latency. Bubble stores the conversation history and user records. Firebase handles the live message push so users see new messages instantly without page refreshes.

The second use case is mobile push notifications. If you've wrapped your Bubble app as a mobile app (using a wrapper like BDK Native or a PWA), Firebase Cloud Messaging (FCM) is the standard way to send push notifications. You trigger notifications from Bubble backend workflows that call Firebase's HTTP API, and FCM delivers them to the user's device.

The third use case is file storage at scale. Bubble's built-in file storage works fine for small to medium apps, but if you're handling large volumes of user-uploaded files — images, videos, documents — Firebase Cloud Storage offers better performance, automatic image resizing via extensions, and a global CDN for fast delivery. Files upload directly from the client to Firebase, bypassing Bubble's server entirely.

Setting Up Firebase with Bubble's API Connector

There's no reliable Bubble plugin for Firebase that covers all services, so the API Connector is your primary tool. Start by creating a Firebase project at console.firebase.google.com. Enable the specific services you need — Realtime Database, Firestore, Cloud Messaging, or Cloud Storage.

For REST API access, Firebase uses either API keys (for client-side reads from public databases) or service account tokens (for server-side authenticated operations). For Bubble backend workflows, you'll use service account authentication. Download your service account JSON file from Firebase Console under Project Settings, then Service Accounts.

The authentication challenge is that Firebase expects a JSON Web Token (JWT) signed with your service account's private key. Bubble can't natively sign JWTs, so you have two options. First, use a middleware service like a simple cloud function that generates Firebase tokens and returns them to your Bubble app. Second, use Firebase's REST API with your database secret (available for Realtime Database), which is simpler but less secure and only works for the Realtime Database, not Firestore or other services.

For the Realtime Database REST API, the setup is straightforward. Your base URL is https://YOUR_PROJECT.firebaseio.com. You can read data with GET requests and write data with PUT, POST, or PATCH requests. Append .json to the path and include your auth parameter. In the API Connector, create calls like: GET https://YOUR_PROJECT.firebaseio.com/messages.json?auth=YOUR_DATABASE_SECRET to read all messages.

Real-Time Data: The JavaScript Bridge

The REST API gives you read/write access to Firebase but not real-time listeners. For true real-time functionality, you need to load Firebase's JavaScript SDK in your Bubble page using an HTML element. This script connects to Firebase directly from the user's browser and listens for data changes, updating Bubble elements through a JavaScript-to-Bubble bridge.

The implementation involves three pieces. First, an HTML element that loads the Firebase SDK and initializes it with your project config (the public config object from Firebase Console). Second, JavaScript code that sets up listeners on specific database paths — for example, listening for new messages in a chat room. Third, a JavaScript-to-Bubble bridge that passes incoming data from Firebase to Bubble elements so your UI updates.

Bubble's JavaScript-to-Bubble feature (available through the Toolbox plugin) lets you define custom events and states that JavaScript code can trigger. When Firebase pushes a new message, your JavaScript listener fires, updates a Bubble custom state with the new data, and your repeating group or text element bound to that state refreshes automatically.

This architecture means Bubble handles the UI, database of record, user management, and business logic. Firebase handles only the real-time data layer. Messages are written to both Bubble's database (via a workflow) and Firebase (via the JavaScript SDK or API call) simultaneously, and Firebase pushes updates to all connected clients in real time.

Push Notifications with Firebase Cloud Messaging

FCM setup in Bubble requires two things: registering the user's device token and sending notifications from backend workflows. When a user opens your app on mobile, the Firebase JavaScript SDK (loaded in an HTML element) requests notification permission and returns a device token. Store this token in Bubble's database on the user record.

To send a notification, create a backend workflow that POSTs to https://fcm.googleapis.com/fcm/send with your FCM server key in the Authorization header and a JSON body containing the target device token, notification title, body, and any custom data payload. This workflow can be triggered by any Bubble event — a new message, a status change, a scheduled reminder.

Common Pitfalls

The biggest mistake is trying to use Firebase as your primary database alongside Bubble. You end up with data split across two systems, constant sync issues, and double the maintenance burden. Use Bubble as the source of truth. Firebase should only hold transient, real-time data that doesn't need to persist long-term — active chat messages, live cursor positions, typing indicators.

Security rules are another common oversight. Firebase's Realtime Database is publicly readable by default if you use test mode during setup and forget to lock it down. Always configure proper security rules before going to production, even if you're primarily accessing data through Bubble's backend.

The JWT authentication issue trips up many builders. If you're hitting Firebase services beyond the Realtime Database (Firestore, Cloud Storage, FCM v1 API), you need proper service account authentication. Budget time for setting up a small middleware function or use a third-party JWT signing service that integrates with Bubble.

DIY vs Hiring a Bubble Developer

Simple Firebase integrations — sending push notifications via FCM or reading/writing to the Realtime Database via REST — are manageable for intermediate Bubble builders. Expect a week of setup and testing. The real-time JavaScript bridge is more complex and requires comfort with JavaScript and the Toolbox plugin. If you've never worked with JavaScript in Bubble, this is where you'll stall.

For production apps that need reliable real-time features, the JavaScript bridge architecture needs proper error handling, reconnection logic, and data consistency checks between Firebase and Bubble. This is where hiring someone experienced pays for itself in weeks of saved debugging time.

Need Real-Time Features in Your Bubble App?

Related guides:

  • Bubble auth0 integration guide

  • Bubble aws s3 integration guide

  • how to build a community platform with Bubble

Firebase fills the real-time gap in Bubble's architecture. If your app needs live updates, push notifications, or high-performance file delivery, Firebase is the standard solution. Talk to our team at Goodspeed Studio to get the architecture right from the start.

Firebase Extends Bubble Where It Matters

Firebase isn't a replacement for Bubble — it's a supplement for specific capabilities Bubble lacks natively. Real-time data syncing, push notifications, and CDN-backed file storage are the primary use cases. Keep Bubble as your source of truth and use Firebase only for the real-time layer to avoid data sync nightmares. Talk to our Bubble developers.

Harish Malhi - founder of Goodspeed

Harish Malhi

Founder of Goodspeed

Harish Malhi is the founder of Goodspeed, one of the top-rated Bubble agencies globally and winner of Bubble’s Agency of the Year award in 2024. He left Google to launch his first app, Diaspo, built entirely on Bubble, which gained press coverage from the BBC, ITV and more. Since then, he has helped ship over 200 products using Bubble, Framer, n8n and more - from internal tools to full-scale SaaS platforms. Harish now leads a team that helps founders and operators replace clunky workflows with fast, flexible software without writing a line of code.

Frequently Asked Questions (FAQs)

Do I need Firebase if I'm just building a standard Bubble app?

Probably not. Bubble's built-in database, file storage, and workflows handle most standard web app needs. Firebase adds value specifically for real-time features (live chat, collaborative editing), mobile push notifications, and high-volume file delivery. If you don't need those, skip it.

Can Firebase replace Bubble's database?

Technically yes, but practically no. Running two databases creates sync headaches and doubles your maintenance work. Use Bubble's database as the source of truth and Firebase only for transient real-time data like chat messages, typing indicators, or live cursors.

How do I send push notifications from Bubble using Firebase?

Store the user's FCM device token in your Bubble database when they first open your app. Then create a backend workflow that POSTs to Firebase Cloud Messaging's API with the device token, notification title, and body. Trigger this workflow from any Bubble event that should notify the user.

Is Firebase free to use with Bubble?

Firebase has a generous free tier (Spark plan) that includes 1GB Realtime Database storage, 5GB Cloud Storage, and unlimited FCM messages. Most Bubble apps in early stages stay well within these limits. You only pay when you exceed the free tier thresholds.

Can I use Firestore instead of Realtime Database with Bubble?

Yes, but it's harder. Firestore's REST API requires proper OAuth2 service account authentication, which means signing JWTs — something Bubble can't do natively. You'll need a middleware function to generate auth tokens. Realtime Database is simpler for Bubble integration because it supports database secret authentication.

How do I handle real-time updates from Firebase in Bubble?

Load Firebase's JavaScript SDK in an HTML element on your Bubble page. Set up listeners on specific database paths. When data changes, use the Toolbox plugin's JavaScript-to-Bubble bridge to push the new data into Bubble custom states, which automatically update your UI elements.

The smartest AI builds, in your inbox

Every week, you'll get first hand insights of building with no code and AI so you get a competitive advantage