File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -25,16 +25,22 @@ The legacy functions:config:* CLI commands are deprecated and will be removed be
2525
2626Migrate configuration to the Firebase Functions params APIs:
2727
28- import { defineString, defineSecret } from "firebase-functions/params";
28+ import { defineJsonSecret } from "firebase-functions/params";
2929
30- export const apiBaseUrl = defineString("API_BASE_URL");
31- export const serviceApiKey = defineSecret("SERVICE_API_KEY");
30+ const config = defineJsonSecret("RUNTIME_CONFIG");
31+
32+ exports.myFunction = functions
33+ .runWith({ secrets: [config] })
34+ .https.onRequest((req, res) => {
35+ const apiKey = config.value().service.key;
36+ // ...
37+ });
3238
3339To convert existing runtime config values, try the interactive migration command:
3440
3541 firebase functions:config:export
3642
37- Learn more: https://firebase.google.com/docs/functions/config-env#migrate-to-dotenv ` ;
43+ Learn more: https://firebase.google.com/docs/functions/config-env#migrate-config ` ;
3844
3945const LEGACY_GUIDANCE_MESSAGE = `${ FUNCTIONS_CONFIG_DEPRECATION_MESSAGE }
4046
You can’t perform that action at this time.
0 commit comments