Skip to content

Commit 6860e4c

Browse files
committed
update messaging to reflect new export flow
1 parent bea37fc commit 6860e4c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/functionsConfig.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,22 @@ The legacy functions:config:* CLI commands are deprecated and will be removed be
2525
2626
Migrate 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
3339
To 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

3945
const LEGACY_GUIDANCE_MESSAGE = `${FUNCTIONS_CONFIG_DEPRECATION_MESSAGE}
4046

0 commit comments

Comments
 (0)