最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to configure the Stripe secret in Firebase Cloud Functions? - Stack Overflow

programmeradmin2浏览0评论

I'm trying to integrate Stripe into a project of mine, and it looks like I can do it on my cloud functions. I'm following this official guide which tells me to add the API key to my firebase config. However, I don't see any files in my cloud functions project (created with npm) that have to do with Firebase config, and seem to match the syntax.

firebase functions:config:set stripe.secret=<YOUR STRIPE SECRET KEY>

What file should I update and where can I find it?

I'm trying to integrate Stripe into a project of mine, and it looks like I can do it on my cloud functions. I'm following this official guide which tells me to add the API key to my firebase config. However, I don't see any files in my cloud functions project (created with npm) that have to do with Firebase config, and seem to match the syntax.

firebase functions:config:set stripe.secret=<YOUR STRIPE SECRET KEY>

What file should I update and where can I find it?

Share Improve this question edited Nov 21, 2024 at 1:10 Frank van Puffelen 600k85 gold badges889 silver badges859 bronze badges Recognized by Google Cloud Collective asked Nov 20, 2024 at 22:23 saadmansaadman 218 bronze badges 1
  • The firebase functions:config:* commands interact with an API (hosted at https://runtimeconfig.googleapis/projects/${projectId}/configs) where the values you provide are stored in your GCP project. They are not stored locally on disk (where they could be accidentally uploaded to git). – samthecodingman Commented Nov 20, 2024 at 22:52
Add a comment  | 

1 Answer 1

Reset to default 1

The instructions are giving you a Firebase CLI command to run. That's what this is:

firebase functions:config:set stripe.secret=<YOUR STRIPE SECRET KEY>

You run the command with your stripe key instead of the placeholder.

There are no files to edit in this case.

You should keep in mind that the given way of setting config params using functions:config:set is outdated, and you should look into the documentation for different and more secure ways of configuring parameters for your functions.

发布评论

评论列表(0)

  1. 暂无评论