Reputation: 16628
Where can I find my Firebase apiKey and authDomain?
I'm setting up my environment to connect to my database.
export const environment = {
production: false,
firebase: {
apiKey: '...',
authDomain: '...',
databaseURL: 'https://******-project.firebaseio.com',
projectId: '*******-project',
}
};
But can't find the apiKey and authDomain inside the firebase console.
Upvotes: 48
Views: 72606
Reputation: 536
Check the below picture for more details.
Upvotes: 2
Reputation: 1
<script src="https://www.gstatic.com/firebasejs/8.8.0/firebase-app.js"></script>
<script>
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
var firebaseConfig = {
apiKey: "XXX-XXXX-XXXX",
authDomain: "xyz.firebaseapp.com", // as follows your app uri xyz.firebaseapp.com/__/auth/handler
projectId: "xyz",
storageBucket: "xyz.appspot.com",
messagingSenderId: "XXXXXXXX",
appId: "1:XXX:web:XXX",
measurementId: "G-XXX"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
</script>
<script src="https://www.gstatic.com/firebasejs/8.8.0/firebase-analytics.js"></script>
Upvotes: 0
Reputation: 31
You can find it in one of the following ways:
Upvotes: 1
Reputation: 2322
If you don't want to create a web app, and the other non-create solution above didnt work for you like it didnt work for me, here's a cheatsheet:
firebaseConfig = {
apiKey: (this one's easy, it's in the 'General' section in your project settings page, aka the Gear icon button),
authDomain: "{project_id}.firebaseapp.com", (without brackets)
databaseURL: "https://{project_id}.firebaseio.com",
projectId: (again, found in 'General' section in Project Settings),
storageBucket: "{project_id}.appspot.com",
messagingSenderId: (found in 'Cloud Messaging' section in Project Settings)
Upvotes: 43
Reputation: 593
The easiest way to find these properties without having to create a new app is to go to your project in the Firebase Console.
Next, click the gear icon beside the Project Overview in the sidebar to the left at the top and click on project settings.
Under the general tab, which is what should open up by default, scroll down a bit til you get to the your apps section. Inside that area, you will find the Firebase SDK Snippet heading.
Under that, you'll have three checkboxes. Go for the Config checkbox, and you will see a JS object declaration, with all the information you'd need about your app to connect to the database.
Upvotes: 46
Reputation: 89
Go to console then open your project
Click Authentication
Look at the upper right side then click the Web setup
Then copy&paste
Upvotes: 2
Reputation: 598740
The easiest way to find these is to:
You'll get a pop up with the values you need.
Upvotes: 66