This Cloud Function (generateWithVertex) demonstrates how to generate text
using Google's Vertex AI Gemini API. It uses
the Firebase Admin SDK for Node.js and Remote Config to manage model parameters,
safety settings, and feature flags.
Follow the User server-side Remote Config with Cloud Functions and Vertex AI guide to:
- Set up your Firebase project.
- Enable required APIs and SDKs.
- Configure IAM permissions.
- Test your function in the Firebase emulator.
- Deploy your function.
Important: Vertex AI and Cloud Functions require a billing account. Review Vertex AI pricing and Cloud Functions pricing before running this function. If you're new to Firebase and Google Cloud, check to see if you're eligible for a $300 credit and a Free Trial Cloud Billing account.
Learn more about Remote Config server implementations at Use Remote Config in server environments.