firebase / firebase/firebase-tools
dataconnect:sdk:generate hardcodes serviceId and location — no per-environment config file support
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.3k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 84
Description
---
### [REQUIRED] Environment info
**firebase-tools:** 15.22
**Platform:** macOS
### [REQUIRED] Test case
1. Create a Firebase project for each environment (DEV, STAGE, PROD).
2. Set up Data Connect in one project and run `firebase dataconnect:sdk:generate`.
3. Observe the generated SDK files — `serviceId` and `location` (e.g. `us-central1`) are hardcoded directly into the generated source code.
4. Attempt to reuse the same generated SDK across environments or regions — not possible without modifying source.
### [REQUIRED] Steps to reproduce
1. Initialize Data Connect: `firebase init dataconnect`
2. Generate the SDK: `firebase dataconnect:sdk:generate`
3. Inspect the generated connector files — `serviceId` and `location` are baked in as string literals.
4. Try to point the same app build at a different Data Connect service (e.g. a staging project) — there is no mechanism to swap these values without regenerating or editing source.
### [REQUIRED] Expected behavior
The Data Connect SDK generator should produce a separate, swappable configuration file (analogous to `google-services.json` / `GoogleService-Info.plist`) that contains environment-specific values like `serviceId` and `location`. This file could be excluded from source control and replaced per environment (DEV/STAGE/PROD) at build time — matching the pattern already established by other Firebase SDKs. This would also simplify multi-region deployments.
### [REQUIRED] Actual behavior
`firebase dataconnect:sdk:generate` hardcodes `serviceId` and `location` directly into the generated SDK source files. There is no mechanism to override these values at runtime or inject them via a per-environment config file. This makes it impossible to maintain a single codebase that targets multiple Data Connect environments (DEV/STAGE/PROD) or multiple regions without either:
- Maintaining separate generated SDK copies per environment, or
- Manually patching the generated source at build time.
This is a significant gap in the Data Connect development lifecycle story compared to other Firebase products.
Contributor guide
Research direction
Start by tracing the firebase dataconnect:sdk:generate command and inspecting the generated connector files where serviceId and location are written. Determine how a swappable per-environment configuration file should be generated and consumed, then verify that the same SDK can target DEV, STAGE, PROD, and different regions without source edits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100