Firebase is Google's mobile platform that helps you quickly develop high-quality apps and grow your business.
Generates content from text input using the Google Gemini API. See the documentation
Creates or replaces a child object within your Firebase Realtime Database. See the docs here
Generates content from both text and image input using the Gemini API. See the documentation
The Firebase Admin SDK API provides powerful backend functionality for Firebase apps. It allows you to interact with Firebase services like Firestore, Firebase Realtime Database, Firebase Storage, and Firebase Authentication directly from a server. With Pipedream, you can harness this API to automate complex workflows, respond to Firebase events in real-time, and integrate with countless other services.
import admin from "firebase-admin"
export default defineComponent({
props: {
firebase_admin_sdk: {
type: "app",
app: "firebase_admin_sdk",
},
},
async run({ steps, $ }) {
// Enter values for the following parameters below this code step,
// These get passed to the initializeApp method below.
const {
projectId,
clientEmail,
privateKey,
region = "firebaseio.com",
} = 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,
}),
databaseURL: `https://${projectId}-default-rtdb.${region}/`,
})
}
},
})
The Google Gemini API is a cutting-edge tool from Google that enables developers to leverage AI models like Imagen and MusicLM to create and manipulate images and music based on textual descriptions. With Pipedream, you can harness this API to automate workflows that integrate AI-generated content into a variety of applications, from generating visuals for social media posts to composing background music for videos. Pipedream's serverless platform allows you to connect Google Gemini API with other apps to create complex, event-driven workflows without managing infrastructure.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
google_gemini: {
type: "app",
app: "google_gemini",
}
},
async run({steps, $}) {
const data = `{{your_promptt}}`;
//E.g. {"contents":[{"parts":[{"text":"Write a story about a magic backpack"}]}]}
return await axios($, {
method: "POST",
url: `https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent`,
headers: {
"Content-Type": "application/json",
},
params: {
key: `${this.google_gemini.$auth.api_key}`,
},
data
})
},
})