Firebase is Google's mobile platform that helps you quickly develop high-quality apps and grow your business.
Go to siteWith the Firebase Admin SDK API, you can build a variety of different applications and tools. For example, you could build a tool to manage your Firebase project's users, or a tool to monitor your Firebase project's data usage. You could also build an app that helps you manage your Firebase project's settings, or an app that helps you troubleshoot your Firebase project's data.
module.exports = defineComponent({
props: {
firebase_admin_sdk: {
type: "app",
app: "firebase_admin_sdk",
}
},
async run({steps, $}) {
const admin = require('firebase-admin')
// Enter values for the following parameters below this code step,
// These get passed to the initializeApp method below.
const { projectId, clientEmail, privateKey } = this.firebase_admin_sdk.$auth
// Before passing the privateKey to the initializeApp constructor,
// we have to replace newline characters with literal newlines
const formattedPrivateKey = privateKey.replace(/\\n/g, '\n')
// See https://firebase.google.com/docs/reference/admin/node/admin.credential.html#cert
if (!admin.apps.length) {
admin.initializeApp({
credential: admin.credential.cert({
projectId,
clientEmail,
privateKey: formattedPrivateKey,
})
})
}
},
})
Firebase Admin SDK uses API keys for authentication. When you connect your Firebase Admin SDK account, Pipedream securely stores the keys so you can easily authenticate to Firebase Admin SDK APIs in both code and no-code steps.
Enable the Cloud Firestore API on your Firebase account, and make sure you've created at least one collection in the database.
Follow these instructions to generate a private key tied to your Firebase service account. This will generate a JSON file that contains the project ID, private key, and client email that you should paste below.
When entering the private key, please add the full string included in the JSON file, from -----BEGIN PRIVATE KEY-----
to -----END PRIVATE KEY-----
, with all newline characters included.