firebase-functions
firebase-functions copied to clipboard
defineSecret creates a list of values in Secret Manager
Related issues
[REQUIRED] Version info
node: v20.13.1
firebase-functions: ^5.0.0
firebase-tools:
firebase-admin: 13.9.0
[REQUIRED] Test case
Original Stack Overflow question: https://stackoverflow.com/a/78496117/12806961
[REQUIRED] Steps to reproduce
- Create a new Firebase Genkit project (firebase init genkit)
- export GOOGLE_GENAI_API_KEY={key}
- Add these lines at the top of the file:
import { defineSecret } from "firebase-functions/params";
defineSecret("GOOGLE_GENAI_API_KEY");
- Run
firebase deploy --only functions
- Navigate to GCP > Cloud Functions > Functions > Select Function > Variables Tab
The GOOGLE_GENAI_API_KEY variable is a list, not a string.
[REQUIRED] Expected behavior
DefineSecret should create a single string environment variable and not a list with a single string value.
[REQUIRED] Actual behavior
Were you able to successfully deploy your functions?
Yes but it didn't work. I needed to change defineSecret
to defineString
.