Thursday, December 20, 2018

Javascript : Adding Firebase to project

If the plan is in using Node.js in privileged environments such as servers or serverless backends like Cloud Functions (as opposed to clients for end-user access like a Node.js desktop or IoT device), you should instead follow the instructions for setting up the Admin SDK.

Below are the 3 steps involved in adding firebase to the web project

1. Create a firebase project in the console.
2. From the project overview page in the Firebase console, click Add Firebase to your web app. If your project already has an app, select Add App from the project overview page.

It will look like the below




The snippet contains initialization information to configure the Firebase JavaScript SDK to use Authentication, Cloud Storage, the Realtime Database, and Cloud Firestore. You can reduce the amount of code that your app uses by only including the features that you need.

From the CDN, include the individual components that you need (include firebase-app first):

Now can run from the local server like this below

$ npm install -g firebase-tools
$ firebase init    # Generate a firebase.json (REQUIRED)
$ firebase serve   # Start development server

references:
https://firebase.google.com/docs/web/setup

No comments:

Post a Comment