angular / angular/angularfire

Feature Request: Firebase SDK Auto Config

Open
#3,218 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
7.8k
Forks
2.2k
Avg merge
22h 28m
Merged PRs (30d)
6

Description

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

Contributor guide

Open the contributing guide

Research direction

Start with the Firebase reserved-URLs SDK auto-configuration reference and the AngularFireModule.initializeApp call shown in app.module.ts. Compare it with the package.json build/getFirebaseConfig workaround and firebaseConfig.json flow; done means initialization can use Firebase SDK auto-configuration without that generated file or extra build step.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, firebase, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.