-
Notifications
You must be signed in to change notification settings - Fork 218
Description
Version info
firebase-functions: 0.8.1
firebase-tools: 3.17.3
firebase-admin: 5.8.1
Were you able to successfully deploy your functions?
Yes.
Question
I have two firebase projects. (Project1 and Project2)
I'm using Service Account info from Project1 into Project2 as I need access to Auth data which resides in Project1. Remote config for Project2 looks as follows:
{
"service_account": {
"private_key": "<project1-private-key>",
"email": "<project1-email>",
"project_id": "<project1-project-id>"
}
}
Initializing Project2 as follows
const config = functions.config();
const fbConfig = functions.config().firebase;
fbConfig.credential = admin.credential.cert({
'private_key': replace(get(config, 'service_account.private_key'), /\\n/g, '\n')),
'client_email': get(config, 'service_account.email'),
'project_id': get(config, 'service_account.project_id')
});
admin.initializeApp(fbConfig);
When I do
const fbConfig = functions.config().firebase
It returns firebase info which belongs to Project1.
"firebase": {
"apiKey": "<project1-api-key>",
"authDomain": "<project1-auth-domain>",
"databaseURL": "<project1-database-url>",
"projectId": "<project1-project-id>",
"storageBucket": "<project1-storage-bucket>",
"messagingSenderId": "<project1-sender-id>"
}
Trying to wrap my head around few questions.
-
How it knows to pull
firebasedetails about Project1? -
Is there a connection between service account used & firebase details which gets pulled? Service account key is the only place where I'm referencing about Project1 in my entire Project2 codebase.
-
When I do
firebase functions:config:getlocally, I only getservice_accountinfo in response. Response doesn't have anyfirebaseinfo in it. Why it doesn't havefirebasedetails?