Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Easily integrate Firebase into your Nuxt project.
The Firebase Module for Nuxt (npm package @nuxtjs/firebase) is a Nuxt 2 integration module that connects a Firebase project to a Nuxt application, exposing Firebase services through a global $fire property on the Vue instance.
This Nuxt 2 module, created by the Nuxt Community and maintained by Pascal Luther, takes a Firebase web app configuration (keys such as apiKey, authDomain, projectId, storageBucket, messagingSenderId, appId, and measurementId) in nuxt.config.js and enables selected Firebase services such as auth, Firestore, and messaging. Once configured, it injects this.$fire into every component, giving you direct access to service instances like this.$fire.auth and this.$fire.firestore. It requires Nuxt 2 and the Firebase v8 SDK; the README explicitly states that Nuxt 3 and Firebase v9 modular syntax are not supported.
$fire injection — Access Firebase services as this.$fire.auth, this.$fire.firestore, this.$fire.messaging, and others anywhere in your Nuxt 2 application.true in the services object in nuxt.config.js, as shown with auth: true in the README.modules array and pass your Firebase web app config with the keys listed above; no extra Firebase initialization code is needed.firebase and @nuxtjs/firebase with npm or Yarn; the module expects Firebase v8 to be present in the project.$fire property.this.$fire.auth.createUserWithEmailAndPassword to register users, as shown in the README example.this.$fire.firestore in pages and components to build data-driven features without manually managing the Firebase SDK instance.$fire accessor, letting you add notifications to your Nuxt app.Install the module and the Firebase SDK, add the module to nuxt.config.js with your Firebase config and the services you need, and the module initializes Firebase when the Nuxt app starts. You then use the injected $fire property in any component or page to reach the enabled services.
No. The README states that the module was written for Nuxt 2 and does not support Nuxt 3, with no current plans to add support. For Nuxt 3, the VueFire Nuxt module is the recommended alternative.
No. The module does not support Firebase v9's new modular syntax. If you want to use modular mode, the README advises implementing Firebase manually, and links to a Medium article describing the process.
The README shows auth as an example and says "any other service" can be enabled. The module documentation at firebase.nuxtjs.org lists the full set of available services, and the README explicitly mentions this.$fire.firestore and this.$fire.messaging.
In a Nuxt 2 project, run yarn add firebase or npm i firebase, then yarn add @nuxtjs/firebase or npm i @nuxtjs/firebase. After that, add the module to nuxt.config.js with your Firebase config.
Yes, the module is released under the MIT License. It is open source and free to use in any project.
