I have 1 storage buckets in Google cloud storage. Firebase create a new bucket and it is default in firebase console. I want to change the default bucket and delete the bucket created by firebase. And how can I find for config settings for my bucket in google cloud storage.
This is for default bucket :
var config = {
apiKey: "xx",
authDomain: "xx.firebaseapp.com",
databaseURL: "https://xx.firebaseio.com",
projectId: "xx",
storageBucket: "xx",
messagingSenderId: "xx"
};
firebase.initializeApp(config);
If you go to your Storage browser in the Cloud console, you will see a list of the storage buckets for your project.
Copy the name of the bucket you want to use and put it in the storageBucket property of the configuration.
Related
This part
const serviceAccount = require('./firestore-reactdb-027d52fa212f.json');
Results in an error:
Module not found: Error: Can't resolve './firestore-reactdb-027d52fa212f.json' in (...)
I downloaded the json file from IAM & admin > Service accounts in the Cloud Platform Console (as instructed here under "initialize on your own server"). I tried also to download the credentials from the console in firebase (project settings -> service account -> generate new private key).
PS: it's in a react app
Those credentials are needed when you make your own service. React app is not a service read about what service is. If you want to use firebase in react app you don't need those secrets. You need firebase config object and you no need to wory about to sharing it. This config object is necesery for firebase to know where he can send requests etc.
Example object with configurations for firebase.
const firebaseConfig = {
apiKey: "...",
authDomain: "...",
projectId: "...",
storageBucket: "...",
messagingSenderId: "...",
appId: "...",
measurementId: "..."
};
I would like to get data from Firebase. I found some tutorials, but all is using Google Credential ServiceAccount to initialize firebase app. this's is tutorial that i found :
https://medium.com/techwasti/spring-boot-firebase-crud-b0afab27b26e , and else tutorial i found, almost like that too, is using ServiceAccount.
But the problem is i cannot get the ServiceAccount from this firebase because it's from third party. that's mean the owner of firebase don't want to give ServiceAccount.json to me, but they give me firebase config to me, like this :
const firebaseConfig = {
apiKey: "apkey",
authDomain: authdomain",
databaseURL: "databaseurl",
projectId: "projectid",
storageBucket: "storragebucket",
messagingSenderId: "messagesenderid",
appId: "appid",
measurementId: "measurementid"
};
So, how can i initialize this firebase using kotlin in my java springboot aplication?
i had try to find the solution, but not found anything,
I would be glad for any help.
If you want to initialize the Firebase Admin SDK, you will need a service account. There are no alternatives for this.
The config for the front end web app that you're showing here will not work at all. That config is only used for frontend apps that are acting as clients on behalf of the end user.
I have firebase realtime database up and running with my expo app. I'm using the web SDL with the following code in my index.js file.
import * as firebase from 'firebase'
const firebaseConfig = {
apiKey: "XXXXXXXXXX",
authDomain: "XXXXXXXXXX",
databaseURL: "XXXXXXXXXX",
projectId: "XXXXXXXXXX",
storageBucket: "XXXXXXXXXX",
messagingSenderId: "XXXXXXXXXX",
}
firebase.initializeApp(firebaseConfig)
However no information is appearing in the analytics section of my firebase console dashboard. It says,
'Your Analytics data will appear here soon
We're ready to start collecting your Analytics data. Integrate the SDK, and within 24 hours you'll see your first reports.'
But have I not already integrated the SDK in my app with the code above? What am I missing here, is there some other link I need to make between the app and the dashboard?
I know that I can customize domain name for firebase hosting.
But how can I customize the firebase database, auth and storage domain name?
eg.
authDomain: example.firebaseapp.com => auth.example.com
databaseURL: example.firebaseio.com => db.example.com
storageBucket: example.appspot.com => storage.example.com
I tried to cname the domain (eg cname auth.example.com to example.firebaseapp.com)
but this cause the https://auth.example.com shows the certificate error.
can I resolve that?
Firebase doesn't offer the ability to whitelabel our services under your own domain.
You could choose to proxy all traffic through Hosting + Cloud Functions, but that would be a significant amount of additional work.
What is the need to offer your own custom domain on these services?
Did you also change the firebase script snippet in your code?
<script src="https://www.gstatic.com/firebasejs/4.4.0/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "yourkey",
authDomain: "auth.example.com",
databaseURL: "https://db.example.com",
projectId: "yourid",
storageBucket: "storage.example.com",
messagingSenderId: "id"
};
firebase.initializeApp(config);
</script>
When you sign up to firebase they tell you to place this snippet in your code:
// Initialize Firebase
var config = {
apiKey: "your api key",
authDomain: "domain",
databaseURL: "database url",
storageBucket: "storage bucket",
messagingSenderId: "messaging sender id"
};
firebase.initializeApp(config);
Turns out i want to version it publicly on Github. Is there a way i can use some kind of environment variable or should i just don't version a credentials.js script.
All the information in that snippet is meant to be publicly shared with the users of your web app.
These are not secrets or credentials, but they're identifiers that allow the app code to find the Firebase project on Google's servers.
That said: many teams do not want to check it in to version control system, but instead force each developer to use their own Firebase project for development/testing.