Getting Started
Requirements
Make sure you are using the newest version of Nuxt and have Firebase installed in your project.
bash
yarn add firebase@^8
bash
npm install firebase@^8
Install
Install the module via NPM or Yarn.
bash
yarn add @nuxtjs/firebase
bash
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
js
modules: [
[
'@nuxtjs/firebase',
{
config: {
apiKey: '<apiKey>',
authDomain: '<authDomain>',
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:
js
modules: ['@nuxtjs/firebase'],
firebase: {
// options
}