April 2018
Intermediate to advanced
284 pages
6h 43m
English
As we saw, Firebase admin SDK is only supported in Node.Js, so we'll create a new project with npm init and install the firebase admin from the npm package.
Run the following command to install firebase admin and save it in your package.json:
npm install firebase-admin --save
Copy the following snippet in your JS file and initialize the SDK; we have added the reference to the JSON file that we downloaded from the Firebase Admin Service account:
const admin = require('firebase-admin');const serviceAccount = require('./firebase/serviceAccountKey.json');admin.initializeApp({ credential: admin.credential.cert(serviceAccount), databaseURL: "https://demoproject-7cc0d.firebaseio.com"});
Now we'll just create Restful API ...