npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nuxt-firebase-webframework

v0.0.10

Published

A nuxt module for using Firebase Webframeworks with Nuxt to deploy full stack applications on Firebase

Downloads

46

Readme

Firebase Webframeworks Nuxt Module

npm version npm downloads License Nuxt

A nuxt module for using Firebase Webframeworks with Nuxt to deploy full stack applications on Firebase 🎉

Features

  • Low config
  • Easy to use
  • Supports Firebase Preview channels
  • Uses Firebase Functions 2nd Gen for SSR

Quick Setup

  1. Add nuxt-firebase-webframework dependency to your project
# Using pnpm
pnpm add -D nuxt-firebase-webframework

# Using yarn
yarn add --dev nuxt-firebase-webframework

# Using npm
npm install --save-dev nuxt-firebase-webframework
  1. Add firebase-admin and firebase-functions dependencies to your project
# Using pnpm
pnpm add firebase-admin firebase-functions

# Using yarn
yarn add firebase-admin firebase-functions

# Using npm
npm install firebase-admin firebase-functions
  1. Add nuxt-firebase-webframework to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    'nuxt-firebase-webframework'
  ]
})
  1. Set ssr: true in nuxt.config.ts
export default defineNuxtConfig({
  ssr: true
  modules: [
    'nuxt-firebase-webframework'
  ]
})
  1. Configure firebase webframeworks using the firebaseWebframework key in nuxt.config.ts.
export default defineNuxtConfig({
  ssr: true
  modules: [
    'nuxt-firebase-webframework'
  ],

  // example configuration - all options below
  firebaseWebframework: {
    projects: {
      default: "my-firebase-project-id"
    },
    frameworksBackend: {
      minInstances: 0,
      maxInstances: 4,
      concurrency: 80,
      region: "europe-west1"
    }
  }
})

That's it! You can now run npm run dev and npm run build to test it out.


Note:

You will need to either configure a firebaseWebframework.projects.default in nuxt.config.ts, or have a .firebaserc file in your project root to use the firebase deploy command.


Deployment

Make sure you have the firebase cli installed locally. See here for instructions.


Important:

You will need to enable the experimental webframeworks feature using the firebase cli tool. This only needs to be done once per installation of firebase-tools. Remember to do this in your cloud build environment if you are using CI/CD.

firebase experiments:enable webframeworks

Make sure you are working with the correct firebase project:

firebase use my-firebase-project-id

Use the firebase deploy command to deploy your app.

firebase deploy

Hint:

You can deploy to multiple projects by specifying the project name:

firebase deploy --project staging

Check out the firebase deploy cli docs for more information.

Options

firebaseWebframework.projects

  • Type: Object
  • Default: {}
  • Required: false

A map of project names to project ids. This is used to configure .firebaserc file which is used by the firebase cli to determine which project(s) to deploy to. Checkout the Firebase project alias documentation

Example:

export default defineNuxtConfig({
  firebaseWebframework: {
    projects: {
      default: "my-firebase-project-id-staging",
      staging: "my-firebase-project-id-staging",
      production: "my-firebase-project-id-production"
    }
  }
})

firebaseWebframework.frameworksBackend

  • Type: HttpRequestOptions
  • Default: {}
  • Required: false

These options are a direct map to the firebase functions 2nd gen options. They are used to configure the firebase functions that are used to serve the nuxt app.

Note that not all regions support firebase webframworks yet. The current supported regions are:

  • us-central1
  • us-west1
  • us-east1
  • europe-west1
  • asia-east1

There is a PR open for firebase-tools cli to add more regions that you should thumbs up if you want to see more regions supported.

Example:

export default defineNuxtConfig({
  firebaseWebframework: {
    frameworksBackend: {
      minInstances: 0,
      maxInstances: 4,
      concurrency: 80,
      region: "europe-west1"
    },
    projects: {
      default: "my-firebase-project-id"
    }
  }
})