@@ -4,11 +4,13 @@ Call the Vertex AI Gemini API with Remote Config and App Check
44Introduction
55------------ 
66
7- This is a sample callable function that authenticates calling apps  with App
7+ This is a sample callable function that authenticates clients  with App
88Check and then sends queries to Gemini using the Vertex AI Gemini API. Vertex
9- AI model parameters are controlled using the Remote Config server
10- functionality provided by the Firebase Admin SDK for Node.js. Use the client
11- provided in ` client/ `  to access the function through basic web page.
9+ AI model parameters (including the model itself) are controlled by
10+ Remote Config server features included in the Firebase Admin SDK for
11+ Node.js.
12+ 
13+ Use the web client provided in ` client/ `  to test the function.
1214
1315-  [ Read more about Remote Config for servers] ( https://firebase.google.com/docs/remote-config/server ) .
1416-  [ Read more about App Check] ( https://firebase.google.com/docs/app-check ) .
@@ -26,22 +28,44 @@ Get Started
2628--------------- 
2729
2830 1 .  Follow the instructions in client/README.md to create a Firebase project,
29-     enable ReCAPTCHA Enterprise, enable Firebase App Check, and add your
30-     Firebase config and ReCAPTCHA Enterprise key to the client config.
31+     enable ReCAPTCHA Enterprise, enable and enforce Firebase App Check, and add
32+     your Firebase config and ReCAPTCHA Enterprise key to the client config.
33+  
3134 2 .  Enable [ recommended Vertex AI APIs] ( https://console.cloud.google.com/vertex-ai ) .
35+  
3236 3 .  Configure a Remote Config server template on the Firebase console. Use the template
3337    described in
3438    [ Use server side Remote Config with Cloud Functions and Vertex
3539    AI] ( https://firebase.google.com/docs/remote-config/solution-server#implementation-create-template ) ,
36-     which contains all of the parameters used in the function sample.
40+     which contains all of the parameters used in this function sample.
41+  
3742 4 .  Install dependencies: ` cd functions && npm install ` 
38-  5 .  If you haven't already done so, install firebase-tools: ` npm i firebase-tools@latest ` 
39-  6 .  Log into Firebase: ` firebase login ` 
43+  
44+  5 .  If you haven't already done so, install firebase-tools:
45+   
46+     ` npm i firebase-tools@latest ` 
47+  
48+  6 .  Log into Firebase:
49+  
50+     ` firebase login ` 
51+  
4052 7 .  Deploy the function. We recommend testing in the
41-     [ Firebase emulator] ( https://firebase.google.com/docs/remote-config/solution-server#implementation-deploy-and-test-in-emulator ) .
53+     [ Firebase emulator] ( https://firebase.google.com/docs/remote-config/solution-server#implementation-deploy-and-test-in-emulator ) :
54+  
55+     ` firebase emulators:start ` 
56+  
4257 8 .  If testing in the emulator, verify that ` testMode `  is set to ` true `  in
43-    ` client/main.ts ` , then start the client: ` cd public && npm run dev ` 
44-  9 .  Open the [ client app in a browser] ( http://localhost:5173 )  and enter a
58+      ` client/main.ts ` , then start the client:
59+ 
60+     ` cd client && npm run dev ` 
61+ 
62+     TIP: If you're using the emulator, you can deploy both the function and hosting
63+          to the emulator. From the ` client `  directory, run ` npm run build ` .
64+          Then, from the parent directory, run ` firebase server --only functions,hosting ` .
65+          Open http://localhost:5000  to access and test the web client's connection
66+          to the ` callVertexWithRC `  function.
67+     
68+  0 .  Open the [ client app in a browser] ( http://localhost:5173 )  and enter a
4569    prompt. To access the Vertex AI Gemini API, make sure that you have
4670    set the ` is_vertex_enabled `  boolean parameter in your Remote Config
4771    server template to ` true ` .
0 commit comments