5 ms·
This is meant to be run in Node.js on a server, not in client-side JavaScript within a web browser.
by th 14y ago
This is meant to be run in Node.js on a server, not in client-side JavaScript within a web browser.
- rpedela 14y agoTheir marketing and docs seem to suggest otherwise. This docs page has client-side Javascript: https://www.firebase.com/docs/web-quickstart.html https://www.firebase.com/docs/web-quickstart.html
- mayop100 14y agoThe original commenter is correct -- this is intended to run fully-client-side. We provide a set of security rules and authentication that allow you to control access. Authentication tokens should always be generated on a trusted servers, either ours (in the case of Firebase Simple Login), or yours if you want to generate custom tokens, or a third party service like Singly. Our billing structure is very similar to a CDN, where you are being charged for actual usage on a multi-tenant architecture.
- rpedela 14y agoOkay, but that does not answer my question. How would I protect my auth tokens in plain-text, client-side Javascript code without an auth server? Do you provide such an auth server? I only see end-user login which is pretty cool, but usually there are portions of a website which can be seen without the end-user being logged in. In the scenario where the end-user is not logged in, how do you correctly calculate my bandwidth and charge appropriately while still protecting my auth tokens if there is no auth server? Who generates the auth tokens is not relevant to my question.