Search⌘ K

[WIP]Setting up the Firebase Realtime Database and Storage

Explore how to integrate Firebase Realtime Database and Storage into an Ember.js application. Learn to set up the necessary adapters and serializers, configure security rules, and enable Firebase Storage to manage product images effectively.

EmberFire provides us with an adapter that’s compatible with Firestore. To use the Firebase Realtime Database, we need an adapter and a serializer that support the Realtime Database. Let’s set up the adapter.

Setting up the Firebase adapter

Let’s open our adapter that EmberFire created for us in the app/adapter/application.js file and make the required changes in it:

JavaScript (JSX)
//app/adapters/application.js
// import FirestoreAdapter from 'emberfire/adapters/firestore';
// export default FirestoreAdapter.extend({
// // Uncomment the following lines to enable offline persistence and multi-tab support
// // enablePersistence: true,
// // persistenceSettings: { synchronizeTabs: true }
// });
import RealtimeDatabaseAdapter from 'emberfire/adapters/realtime-database';
export default RealtimeDatabaseAdapter.extend({
});
  • Lines 3–9: We remove the FirestoreAdapter that was created by EmberFire.
  • Lines 12–15: We add the RealtimeDatabaseAdapter.
    • Line 12: We import the RealtimeDatabaseAdapter from the adapters installed by EmberFire. All the EmberFire
...