How do I handle my Firebase API key in a production application?
I have the following component:
<firebase-app
id="firebase"
auth-domain="<domain>"
database-url="<url>"
api-key="<api_key>">
</firebase-app>
I'm using the Polymer Starter Kit with Firebase hosting. Is there somewhere to designate my API key as an environment variable and pass the variable to the application when I start the app?
I use polymer build to build my app, then firebase deploy to push my app to Firebase.
Related
I am developing a project with Firebase backend, utilising Firebase Functions. I actually two projects: myProject and myProject-test (used for deployment testing).
When submitting API calls, my (React) front-end is configured to call the myProject-test URL when running in local development, and only direct the calls to myProject when deployed on PROD.
The problem I am facing is that when I start my cloud functions emulator using firebase emulators:start, my cloud functions get started on the localhost:5001/myProject/... url instead of localhost:5001/myProject-test/..., and hence the API calls from my local development instance never arrive.
How can I control for which project the emulators start?
This is what the firebase use command is for. Read the documentation on managing aliases. You can run the command firebase use PROJECT_ID|ALIAS to set the current project or alias that is currently use use for the emulator or other commands.
While developing a flutter web app, I was using the dev firebase project. Now, when the development is finished it is required to use the production firebase project for production. How can this be done other then simply swapping the firebase dev configuration from index.html with the prod firebase config before building the app.
I tried this tutorial Dynamic HTML elements but I couldn't adapt it to my solution.
I thought that the configuration could be added as a child but an error was thrown:
Expected a value of type 'Element', but got one of type 'FirebaseOptions'
I'm new to web development and I am building a project with Firebase auth for email/password authentication system. Is it possible to deploy the project using docker? Actually I want to use Docker to deploy my project. And I understand that Firebase Auth just provides the functionality to log in users. Does that mean Firebase Auth can use back end system that is part of Firebase?
I'm using Google Firebase: Database (to store my data) and Hosting (to run my web application). The web application is build with Webpack/Vue.
Now I would like to use some Database Functions as a backend API for some server handling.
Is this possible? If so, how can I deploy two separate projects to Firebase Hosting and Functions?
I dont know if this is what you're looking for but you can either
firebase deploy --only hosting or database or functions
or install firebase in different
I want to try the demo for polymerfire in firebase. To get it run locally I followed these steps. But what exact steps do I need to do to get it to run in firebase?
I figured firebase init and firebase deploy should be run but the browser only displays errors in the console. Must the polymer project be build in a certain way and what should the firebase "public" folder be?
All files from public folder will be deployed to your Firebase static web hosting, so you can access them though your Firebase hosting address like https://projectname-5gek53.firebaseapp.com/. This allows you to upload your web app.
You build your polymer app (I guess you need to run polymer build). You drag all files generated as production build to your public folder. Next, you run firebase deploy and after deployment process your app will be accessible from your hosting address as I mentioned above.
Edit: Polymerfire demo is actually not that simple to export, but I found a really nice tutorial step-by-step from Google Codelabs here is a link Build a Progressive Web App with Firebase, Polymerfire and Polymer Components
I just installed a new version of the polymer cli and Firebase cli. When I do a Polymer build, no build/bundled or build/unbundled is created.
I do get a build/default, which I can run with a firebase serve and a firebase deploy. So something has changed recently. just fyi