We are very excited to share that with this week's release of the JS SDK v10.8.0, the Firebase team has added the first Web Extensions entry point for Firebase modules!
There have recently been several threads on the mailing list about issues with some extensions using Firebase being rejected from the Chrome Web Store. These were ultimately because of remotely hosted code that was being included for Firebase Auth. Extensions are responsible for all of the code in their extension being policy compliant, regardless of who authored it. While we have been working with extension developers to fix the issue in the short term, we have also been working closely with the Firebase team to create a longer term solution.
The new Web Extensions version of the Firebase SDK bundles all required code and avoids using remote hosted code. As of now, this is just a part of Firebase Auth. But it sets the precedent within the Firebase SDK to allow for other extension specific issues that arise to be quickly addressed through their rapid release cycles. This is not a fork of Firebase, but rather a web extension specific subset of their main API. You can use it by following along with these steps:
Ensure that your Firebase SDK is updated to 10.8.0
Where you are importing firebase/auth, use firebase/auth/web-extension instead
That's it! This will load a custom build of Firebase Auth that strips out the remotely hosted code. It is important to note that not all authentication methods are currently supported with this. If you are reliant on reCaptcha within your authentication flow, then this flavor will not work for you. There are additional complexities how reCaptcha requires it to be used that are not able to be quickly fixed here. This is not a one time update, however. We are still collaborating with the Firebase and reCaptcha team and hope to be able to get a drop in solution for all developers.
If you are a Firebase user, and see places where the SDK could be changed to better fit the nuances of the web extension ecosystem, let us know! We are really happy with the collaboration we have had with Firebase, and look forward to a lot more in the future.
Patrick on behalf of Chrome Extensions DevRel