Getting Started

Requirements

Make sure you are using the newest version of Nuxt and have Firebase installed in your project.

yarn add firebase
npm install firebase

Install

Install the module via NPM or Yarn.

yarn add @nuxtjs/firebase
npm install @nuxtjs/firebase

Configure

Add the below code to your nuxt.config.js modules array and adjust it according to your needs.

Visit the config section for a detailed overview about each configuration.

Example Configuration

nuxt.config.js
modules: [
    [
      '@nuxtjs/firebase',
      {
        config: {
          apiKey: '<apiKey>',
          authDomain: '<authDomain>',
          databaseURL: '<databaseURL>',
          projectId: '<projectId>',
          storageBucket: '<storageBucket>',
          messagingSenderId: '<messagingSenderId>',
          appId: '<appId>',
          measurementId: '<measurementId>'
        },
        services: {
          auth: true // Just as example. Can be any other service.
        }
      }
    ]
  ],

See list of all available services here.

You can also separate the config from the module array by using the firebase object:

nuxt.config.js
modules: ['@nuxtjs/firebase'],

firebase: {
   // options
}