New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@paulbarre/vue-firebase

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paulbarre/vue-firebase

Vue plugin to easily setup Firebase API

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Firebase plugin for Vue.js

Introduction

Currently these are the supported features:

  • Connection to Firestore

Plugin under development, a lot more to come in a close future (?).

Installation

Install the package into your Vue application:

npm i @paulbarre/vue-firebase firebase

Install the plugin into your application:

import Vue from 'vue'
import VueFirebasePlugin from '@paulbarre/vue-firebase'

const options = {
    ...
}

Vue.use(VueFirebase, options)

Currently the plugin recognizes the following options:

NameTypeDefaultDescription
configObjectSee belowFirebase configuration
firestoreBooleanfalseSets up firestore into your application

The config option is used to initialize the Firebase application.

NameTypeDescription
projectIdStringThe ID you set to your firebase project. It is visible into the URL when you are on the Firebase console of your project, or it is visible into the project settings page.

See the official documentation for further details.

Real world example, into a Vue app created with Vue CLI:

import Vue from 'vue'
import App from './App.vue'

import VueFirebasePlugin from '@paulbarre/vue-firebase'

const projectId = '<put your project id here>'

Vue.use(VueFirebasePlugin, {
  firestore: true,
  config: {
    projectId
  }
})
Vue.config.productionTip = false

new Vue({
  render: function (h) { return h(App) },
}).$mount('#app')

Firestore

In order to setup Firestore into your application, it is imperative that you give the plugin config parameters:

  • projectId

VueFirebasePlugin provides $firestore attribute to your Vue components:

App.vue

<script>
export default {
  name: 'app',
  async mounted () {
    const ref = this.$firestore.collection('<the collection you want to use>')
      const snapshot = await ref.get()
      snapshot.forEach(doc => {
          console.log(doc.data())
      })
  }
}
</script>

For more information on how to use $firestore, check at the official documentation.

Keywords

FAQs

Package last updated on 22 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc