npm.io
1.0.2 • Published 9 years ago

adonis-firebase-sdk

Licence
MIT
Version
1.0.2
Deps
1
Vulns
1
Weekly
0
Stars
4

adonis-firebase-sdk

JavaScript Firebase SDK wrapper for Adonis JS

Install

npm install adonis-firebase-sdk --save

Usage

Create a file in app/config/firebase.js and paste the code below by replacing it's values where necessary:

'use strict'

/*
 |--------------------------------------------------------------------------
 | Firebase
 |--------------------------------------------------------------------------
 |
 | Provide details of firebase project
 |
 */

module.exports = {

  /*
   |--------------------------------------------------------------------------
   | API key
   |--------------------------------------------------------------------------
   */
  apiKey: "",
  /*
   |--------------------------------------------------------------------------
   | Auth
   |--------------------------------------------------------------------------
   */
  authDomain: "",
  /*
   |--------------------------------------------------------------------------
   | Database
   |--------------------------------------------------------------------------
   */
  databaseURL: "",
  /*
   |--------------------------------------------------------------------------
   | Hosting
   |--------------------------------------------------------------------------
   */
  storageBucket: ""

}

Also you need to add the provider to AdonisJS at app/bootstrap/app.js:

const providers = [
   ...
   'adonis-firebase-sdk/providers/FirebaseProvider'
]

then you can simply call it from within controllers etc:

const Firebase = use('Firebase')

Keywords