Skip to content

Instantly share code, notes, and snippets.

@hieptl
Created August 28, 2021 14:57
Show Gist options
  • Save hieptl/8c09fec871477ef7c54be8e29a17aa7e to your computer and use it in GitHub Desktop.
Save hieptl/8c09fec871477ef7c54be8e29a17aa7e to your computer and use it in GitHub Desktop.
Firebase - Javascript Chat App
const firebaseConfig = {
apiKey: `${config.apiKey}`,
authDomain: `${config.authDomain}`,
databaseURL: `${config.databaseURL}`,
projectId: `${config.projectId}`,
storageBucket: `${config.storageBucket}`,
messagingSenderId: `${config.messagingSenderId}`,
appId: `${config.appId}`,
measurementId: `${config.measurementId}`
};
const app = !firebase.apps.length
? firebase.initializeApp(firebaseConfig)
: firebase.app();
const realTimeDb = app.database();
const db = app.firestore();
const auth = app.auth();
const storage = firebase.storage();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment