Skip to content

Latest commit

 

History

History
59 lines (46 loc) · 2.76 KB

File metadata and controls

59 lines (46 loc) · 2.76 KB

Test client for call-vertex-remote-config-server

Introduction

This is a basic web app that calls the callVertexWithRC function. The function uses values stored in Remote Config server templates with the Firebase Admin SDK to dynamically update Vertex AI Gemini API parameters. Access is controlled using Firebase App Check.

Important: Vertex AI and Cloud Functions require a billing account. Review Vertex AI pricing and Firebase 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.

Get started

  1. Create a Firebase project and register a web app.
  2. Create a ReCAPTCHA Enterprise key in the same project.
  3. Enable App Check in the Firebase console with the ReCAPTCHA Enterprise site key you created.
  4. Copy your Firebase project config and your ReCAPTCHA Enterprise site key into the appropriate places in config.ts in this directory.
  5. In this directory, run npm install.
  6. Set up and deploy the function as described in ../README.md.
  7. In this directory, run npm run dev to run the client.

To run this app against the callVertexWithRC function running in the Firebase emulator, ensure that testModein main.ts is set to true. Before testing with a deployed (i.e., not emulated) function, set testMode to false.

TIP: You can build the client and deploy to Firebase Hosting by running npm run build from the client directory. Hosting deliverables are generated and saved in client/dist and you can then deploy to the emulator or Firebase Hosting from the parent directory. We recommend deploying to the emulator first--you can use the following command to deploy the function and web client simultaneously:

 firebase serve --only functions,hosting 

Support

License

© Google, 2024. Licensed under an Apache-2 license.