Nuxt Firebase
Integrate Firebase with Nuxt (3)
Nuxt3 Ready
Built on Vue 3, can use very easily by Auto-imports and Composables.
Firebase v9 SDK Ready
A new API surface allows to tree-shake so that make apps small.
Auth with SSR
By using Service Worker, identity is also available on the server-side and API-routes.
Setup
- Install dependencies
# npm
npm install -D firebase @e-chan1007/nuxt-firebase
# yarn
yarn add -D firebase @e-chan1007/nuxt-firebase
# pnpm
pnpm add -D firebase @e-chan1007/nuxt-firebase
Don't forget to install firebase
.
- Add this module to the Nuxt config
export default defineNuxtConfig({
modules: [
'@e-chan1007/nuxt-firebase'
],
firebase: {
// set options here...
}
})
- Use in your pages, components or server routes
<template>
<p>Hello {{ currentUser?.displayName }}!</p>
</template>
<script lang="ts" setup>
const { currentUser } = useAuth();
</script>