I was struggling to get the Firebase database to work, and it turns out its due to the fact that the normalizeDbUrl() function does not conform to actual database URLs, and cannot generate them correctly simply from the Firebase project ID.
The issue is that database URLs that are not in the US region take the form
Thanks for discovering this! I decided to do a fix based on yours that doesn't change or add to the API surface: just pass the full Firebase databaseURL as appId, which keeps consistency with the other strategies. Released as 0.14.0.
I was struggling to get the Firebase database to work, and it turns out its due to the fact that the
normalizeDbUrl()
function does not conform to actual database URLs, and cannot generate them correctly simply from the Firebase project ID.The issue is that database URLs that are not in the US region take the form
While the US region database URLs take the form
In both cases the
normalizeDbUrl()
function does not generate a correct URL from just the project ID.It seems the simplest solution is just add a
databaseURL
option to the config, and to just use that directly, which is what this pull request adds.I kept the non-functional normalize function and the final 2 lines in
init()
, though they should not be used