react-firebase-chat icon indicating copy to clipboard operation
react-firebase-chat copied to clipboard

No databaseURL in the SDK snippet

Open Prathamkrishna opened this issue 4 years ago • 2 comments

I was watching the video and working along. But my firebase app does not have the 'databaseURL' in the SDK snippet but it has an extra 'measurementID'.

Prathamkrishna avatar Apr 21 '21 10:04 Prathamkrishna

I think you have to re-generate the SDK config by deleting the existing app and creating a new web app.

This will works because you have generated the SDK config before enabling Firestore.

bharathmsd7 avatar May 12 '21 09:05 bharathmsd7

By default, when you add the app it will not provide a databaseUrl which ends with firebaseio.com.

The issue #4221 created here responds to this very stuff.

If you want to follow the video verbatim, you need to go to the Dashboard and click Realtime Database and enable it. This will provide you with a databaseUrl.

Now, the app really does not make any use of the Realtime Database as Cloud Firestore is just capable enough to handle the stuff.. You can modify the config to remove the key databaseUrl:

const config = {
  apiKey: "*********",
  authDomain: "********",
  projectId: "*********",
  storageBucket: "********",
  messagingSenderId: "*******",
  appId: "*********",
  measurementId: "G-********"
};

Now coming to measurementId, yeah Google now lets developers to collect analytics (optional) by integrating it with Google Analytics. This is an optional but very powerful feature, and to have more insight watch the Video on Youtube made by Fireship.

Hope it helps..

anweshandev avatar Jul 19 '22 21:07 anweshandev