Skip to content

jrishabh55/adonis-firebase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adonis-firebase

Firebase client and admin SDK wrapper for Adonis JS 4.0

Install

npm install adonis-firebase --save

Usage

Create a file in app/config/firebase.js and paste the code below by replacing it's values where necessary. Sample configuration can also be found in src/sample-config/firebase.js:

'use strict';

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

module.exports = {

  /*
   |--------------------------------------------------------------------------
   | Firebase Admin credentials key file
   |--------------------------------------------------------------------------
   */
  credentials: "",
  /*
   |--------------------------------------------------------------------------
   | 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/providers/Firebase',
   'adonis-firebase/providers/FirebaseAdmin'
];

then you can simply call it from within controllers etc:

const Firebase = use('Firebase');
const FirebaseAdmin = use('FirebaseAdmin');

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published