firebase/quickstart-nodejs

Connect using firebase rather than firebase-admin?

vkarpov15 opened this issue · 2 comments

The docs tell me to use the client JS SDK for end-user access:

image

But there's no examples for how to do this with nodejs.

I believe this section is supposed to cover that: https://firebase.google.com/docs/web/setup#add_firebase_to_your_app

In particular:

// Initialize Firebase
// TODO: Replace with your project's customized code snippet
var config = {
  apiKey: "<API_KEY>",
  authDomain: "<PROJECT_ID>.firebaseapp.com",
  databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
  storageBucket: "<BUCKET>.appspot.com",
};
firebase.initializeApp(config);

Yup there are not really anything differences in using the JS sdk ou in Node vs Web. The only difference is in the install and import.

Install the SDK with: npm install --save firebase
Import the SDK with: var firebase = require('firebase');