题意:我可以在哪里安全地保存我的 OpenAI API 密钥用于我的 Flutter 应用
问题背景:
I am trying using ability of openai for my flutter app, but for now I don't have experience to save apikey safely and efficiently etc. I learned that I can save my openai apikey somewhere in the firebase and let flutter client visit the firebase to get the access to openai.
我正在尝试将 OpenAI 的功能应用于我的 Flutter 应用,但目前我没有安全且高效地保存 API 密钥的经验。我了解到我可以将我的 OpenAI API 密钥保存在 Firebase 中,然后让 Flutter 客户端访问 Firebase 以获取 OpenAI 的访问权限。
But for now I do not know the total correct process or code example to handle this issue, could someone share some article or some existing method between flutter and firebase for saving apikey saving? It could be great to share the dis-and-advantage for costs or time-consuming.
但目前我不知道处理这个问题的完整正确过程或代码示例,有人能分享一些关于 Flutter 和 Firebase 之间保存 API 密钥的文章或现有方法吗?如果能分享相关的优缺点,包括成本或耗时情况,将会很有帮助。
问题解决:
One other solution is to use the '--dart-define' environment flag.
另一个解决方案是使用 `--dart-define` 环境标志。