Created
August 28, 2021 14:57
-
-
Save hieptl/8c09fec871477ef7c54be8e29a17aa7e to your computer and use it in GitHub Desktop.
Firebase - Javascript Chat App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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