angular / angular/angularfire

Feature Request: Firebase SDK Auto Config

未关闭
#3,218 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
7.8k
派生
2.2k
平均合并
22 小时 28 分钟
30 天内合并 PR
6

描述

I would like to propose Firebase SDK AutoConfig as an option when initializing the app:
`AngularFireModule.initializeAppWithAutoConfig(),`

Right now, I have a workaround by adding this 2 lines in `package.json` so that the build process will pull the config from my Firebase project:
```
"build": "npm run getFirebaseConfig && ng build",
"getFirebaseConfig": "firebase apps:sdkconfig web --json > ./firebaseConfig.json",
```
Then in my `app.module.ts`:
```
import * as firebaseConfig from '../../firebaseConfig.json';
AngularFireModule.initializeApp(firebaseConfig.result.sdkConfig),
```
It works but it has an extra immediate step to generate the `firebaseConfig.json`. So, it will be great if AngularFireModule takes care of it.

Reference:
https://firebase.google.com/docs/hosting/reserved-urls#sdk_auto-configuration

贡献指南

打开贡献指南

调研方向

从 Firebase reserved-URLs SDK 自动配置参考文档以及 app.module.ts 中显示的 AngularFireModule.initializeApp 调用开始。将其与 package.json 中的 build/getFirebaseConfig workaround 和 firebaseConfig.json 流程进行比较;完成的标准是初始化可以使用 Firebase SDK 自动配置,而不需要该生成的文件或额外的 build 步骤。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, firebase, typescript
领域
frontend
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。