firebase / firebase/firebase-js-sdk
FR: Consider making API URLs configurable
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Description
### [REQUIRED] Describe your environment
* Firebase SDK version: 5.8.3
### The issue
We have a business requirement to make our web app available to customers in mainland China. As you know, the great firewall blocks Google Cloud Products if you're in China. To circumvent it, we decided to proxy Firebase through a custom domain.
- Fortunately, Firestore already exposes a setting to configure the host to connect to, so proxying this should be rather easy.
- Overriding the firebase-functions HTTPS callable URL generation is hacky & alters undocumented code, but trivial, just overwrite the function here: https://github.com/firebase/firebase-js-sdk/blob/03a4c8dbf58bab3db5742c094c91f46bbf446155/packages/functions/src/api/service.ts#L81
Doing this with other Firebase products (such as Storage or Auth), however, isn't that simple. If there was a way to customize the rest of the SDKs URLs, we'd be able to use Firebase in mainland China with only a little bit of additional effort (which I'm fine to bear by myself).
WDYT? I'm fine sending a PR implementing this.
Contributor guide
Assessment
This issue has not been assessed yet.