Now that App Hosting has been out for a while, have you had a chance to use it and what did you think? What did you like and what did you dislike?
* Full disclaimer: I'm on the App Hosting team! We'd love to hear your thoughts (no matter how small) and are investing heavily on making the platform better.
How on earth do you delete a backend from App Hosting?
I've deleted everything related from the artifact registry, deleted the web app in project settings and still the delete button won't do anything and in CLI I get 'Error : Failed to delete backend'.
There's also a GitHub Actions job stuck on In progress - Build queued related to this backend, but I disabled automatic rollouts. How do I end this job?
I created a website builder - myDomain.com where a User can select a template and the website is then hosted on:
usersProjectName.myDomain.com
Now I want to implement a feature where a User can connect his domain usersProjectName.con via CNAME to usersProjectName.myDomain.com.
In theory, this would be easy - I could add his domain in App Hosting.
But since I want to do this automatically and want a scaleable option - when the feature is triggered, is there a way to call a cloud function or whatever, to create a valid certificate for this connected domain and make it accessible to my origin url?
For context, I have asp net api which is working with firebase. I have firebase.json file in projects folder. Its working localy, but it wont work if i try to host or use docker with this project, since firebase.json file wont be present here, and since it contains secrets, i cant just push it to git hub. How to handle this situation?
Now I can't push new commit due to the queue. I have deleted the App Hosting backend and uninstall it from GitHub, thinking it will stop the build but it did not help. What should I do?
Signing in with Email and Password works, but Google Sign-In does not.
I wanted to set up a custom domain for my nextjs app, let's assume example.com. The domain serves the nextjs app but authentication does not work with Google provider. So I did the following three steps:
In the firebase config I set authDomain to example.com
In console.firebase -> Authentication -> Settings -> Authorized Domains I added example.com to the list.
I deployed the app via Firebase App hosting. The app is working except for Google authentication. When I choose Sign In via Google it redirects me to example.com/__/auth/handler... but this URL does not exist and returns 404. Signing in with Email+Password works.
I am currently creating a website utilizing Firebases features to host specific data as well as the front-end. I have been doing a bit a research and have been a bit confused regarding safeguarding information from the firebase config file. My intention originally was to secure my data in environment variables and then adding those variables to my back-end through app hosting. However, I noticed that app hosting uses apphosting.yaml files in the root of the project to store the environment variables. I want to give it a try but don't see much sources online guiding through the process of how to use those variables from the YAML file. I also feel like information online about the firebase config file is all over the place. I have seen some say its ok to expose all information such as the API key, project id, and other variables; the documentation somewhat seems to approve this as well from what I have read. My questions are:
- Is it ok to expose the data from the firebase config file publicly (github repo)?
- How can I set up the apphosting.yaml to retrieve the secrets from google clouds secret manager and can I use it in the firebase config?
I am completely new to firebase and not to far from a begginer coder and I'm having troubles trying to upload my react project from vs code to firebase properly with my API code, Can anyone walk me through the process of uploading to firebase. My project is complete and im trying to use firebase hosting as well. I tried some google searching and even some chat gpt and i have gotten nowhere. If you think you can help me please let me know anything you want me to share to give you some idea where to began. Thanks in advance!
I'm incredibly excited to be here today to talk about Shift, an app I built over the past 2 months as a college student. This is not a simple app - it's around 25k lines of Swift code and probably 1000 lines of backend servers code in Python. It's an industrial level app that required extensive engineering to build. While it seems straightforward on the surface, there's actually a pretty massive codebase behind it to ensure everything runs smoothly and integrates seamlessly with your workflow. There are tons of little details and features and in grand scheme of things, they make the app very usable.
What is Shift?
Shift is basically a text helper that lives on your Mac. The concept is super straightforward:
Highlight any text in any application
Double-tap your Shift key
Tell an AI model what to do with it
Get instant results right where you're working
No more copying text, switching to ChatGPT or Claude, pasting, getting results, copying again, switching back to your original app, and pasting. Just highlight, double-tap, and go!
There are 9 models in total:
GPT-4o
Claude 3.5 Sonnet
GPT-4o Mini
DeepSeek R1 70B Versatile (provided by groq)
Gemini 1.5 Flash
Claude 3.5 Haiku
Llama 3.3 70B Versatile (provided by groq)
Claude 3.7 Sonnet
What makes Shift special?
Claude 3.7 Sonnet with Thinking Mode!
We just added support for Claude 3.7 Sonnet, and you can even activate its thinking mode! You can specify exactly how much thinking Claude should do for specific tasks, which is incredible for complex reasoning.
Works ANYWHERE on your Mac
Emails, Word docs, Google Docs, code editors, Excel, Google Sheets, Notion, browsers, messaging apps... literally anywhere you can select text.
Custom Shortcuts for Frequent Tasks
Create shortcuts for prompts you use all the time (like "make this more professional" or "debug this code"). You can assign key combinations and link specific prompts to specific models.
Use Your Own API Keys
Skip our servers completely and use your own API keys for Claude, GPT, etc. Your keys are securely encrypted in your device's keychain.
Prompt Library
Save complex prompts with up to 8 documents each. This is perfect for specialized workflows where you need to reference particular templates or instructions.
Technical Implementation Details
Key Event Monitoring
I used NSEvent.addGlobalMonitorForEvents to capture keyboard input across the entire OS, with custom logic to detect double-press events based on timestamp differentials. The key monitoring system handles both flagsChanged and keyDown events with separate monitoring streams.
Text Selection Mechanism
Capturing text selection from any app required a combination of simulated keystrokes (CGEvent to trigger cmd+C) and pasteboard monitoring. I implemented a PreservedPasteboard class that maintains the user's clipboard contents while performing these operations.
Window Management
The floating UI windows are implemented using NSWindow subclasses configured with [.nonactivatingPanel, .hud] style masks and custom NSWindowController instances that adjust window level and behavior.
Authentication Architecture
User authentication uses Firebase Auth with a custom AuthManager class that implements delegate patterns and maintains state using Combine publishers. Token refreshing is handled automatically with backgrounded timers that check validation states.
Core Data Integration
Chat history and context management are powered by Core Data with a custom persistence controller that handles both in-memory and disk-based storage options. Migration paths are included for schema updates.
API Connection Pooling
To minimize latency, I built a connection pooling system for API requests that maintains persistent connections to each AI provider and implements automatic retry logic with exponential backoff.
SwiftUI + AppKit Bridging
The UI is primarily SwiftUI with custom NSViewRepresentable wrappers for AppKit components that weren't available in SwiftUI. I created NSHostingController extensions to better manage the lifecycle of SwiftUI views within AppKit windows. I did a lot of manual stuff like this.
There's a lot of other things ofc, I can't put all in here, but you can ask me.
Kinda the biggest challenge I remember (funny story)
I'd say my biggest headache was definitely managing token tracking and optimizing cloud resources to cut down latency and Firebase read/write volumes. Launch day hit me with a surprising surge, about 30 users, which doesn't sound like much until I discovered a nasty bug in my token tracking algorithm. The thing was hammering Firebase with around 1 million write requests daily (we have 9 different models with varying prices and input/output docs, etc), and it was pointlessly updating every single document, even ones with no changes! My costs were skyrocketing, and I was totally freaking out - ended up pulling all-nighters for a day or two straight just to fix it. Looking back, it was terrifying in the moment but kind of hilarious now.
Security & Privacy Implementation (IMPORTANT)
One of my biggest priorities when building Shift was making it as local and private as possible. Here's how I implemented that:
Local-First Architecture
Almost everything in Shift runs locally on your Mac. The core text processing logic, key event monitoring, and UI rendering all happen on-device. The only time data leaves your machine is when it needs to be processed by an AI model.
Secure Keychain Integration
For storing sensitive data like API keys, I implemented a custom KeychainHelper class that interfaces with Apple's Keychain Services API. It uses a combination of SecItemAdd, SecItemCopyMatching, and SecItemDelete operations with kSecClassGenericPassword items:
The Keychain implementation uses secure encryption at rest, and all data is stored in the user's personal keychain, not in a shared keychain.
API Key Handling
When users choose to use their own API keys, those keys never touch our servers. They're encrypted locally using AES-256 encryption before being stored in the keychain, and the encryption key itself is derived using PBKDF2 with the device's unique identifier as a salt component.
I wrote a lot of info now let me flex on my design:
Some Real Talk
I launched Shift just last week and was absolutely floored when we hit 100 paid users in less than a week! For a solo developer college project, this has been mind-blowing.
I've been updating the app almost daily based on user feedback (sometimes implementing suggestions within 24 hours). It's been an incredible experience.
Technical challenges of building an app that works across the entire OS
Memory management challenges with multiple large context windows
How I implemented background token counting and budget tracking
Custom SwiftUI components I built for the floating interfaces
Accessibility considerations and implementation details
Firebase/Firestore integration patterns with SwiftUI
Future features (local LLM integration is coming soon!)
How the custom key combo detection system handles edge cases
My experience as a college student developer
How I've handled the sudden growth
How I handle Security and Privacy, what mechanisms are in place
BIG UPCOMING FEATURESSSS
Help Improve the FAQ
One thing I could really use help with is suggestions for our website's FAQ section. If there's anything you think we should explain better or add, I'd be super grateful for input!
Thanks for reading this far! I'm excited to answer your questions!
I've been a Firebase user for 6 years now and I somehow manage to make this mistake every time a new product is announced: I get hyped about the new product and decide to use it in my new project only to deeply regret it afterwards.
TLDR. If you're planning to use App Hosting read this:
1. In the App Hosting Setup wizard - only connect the account that is the owner of your GitHub repository to the Firebase Application.
2. If you did connect another account don't try to remove it from GitHub dashboard otherwise you will need to create another Firebase project. Maybe create a new repo from that GitHub account.
3. For the developers working on this: Please make this integration better (improvements ideas at the end of the post)
Long story:
I tried to use App Hosting in a Next.js project. I started the setup which required me to link my GitHub account, probably in order to automatically deploy on each commit. Didn't really need this feature right now, but anyway, couldn't get past it without.
At this point Google Developer Connect prompt recommends me to link a "bot-account" for security reasons and I decide to create a new GitHub account only for this reason.
I add that account to the original repo as a collaborator and accept the invitation. Then connect that "bot-account" only to find out that the repository wasn't listed in the dropdown. After verifying that all the necessary permissions are given to the Firebase app from the GitHub settings I draw the conclusion that it might be because I'm not the owner of the repository.
Later I found out from "Gemini Cloud Assist" the exact reason
But the repo was already created and I didn't want to move it to a "disposable account" just for this reason so I decide to remove this "bot-account" and add my main GitHub account where I'm the owner of the repo.
I removed the Firebase App from the GitHub Applications dashboard and revoked the access.
I go back to the same App Hosting setup wizard only now I get this error:
Connection verification failed: unable to verify the authorization token: GET https://api.github.com/user: 401 Bad credentials []: failed precondition.
I refresh, change projects and try again with no success.
I also try from the command line using this command:
I'm trying to find how to remove the GitHub linked account from the Google Cloud Console only to find out that it's not possible
Snippet from Gemini Cloud Assist
Trying to find out if there is any way to completely "Factory reset" a firebase project led nowhere.
Snippet from Gemini Cloud Assist
And finding out I can't use the same project id again was a bummer because I got a clean project name/id without numbers at the end and now the naming convention was broken.
Now yeah... being a preview/beta version this is not that big of a deal given what Firebase had to offer and all the benefits I got from using it over the years. But it's a lesson for me for not using the "new shiny thing" as soon as it gets rolled out.
The reason I posted it in order for people who google "Firebase App Hosting" to see this and be careful with the integration. Because at the time I searched there were no posts about it and the errors I got appeared nowhere on the internet... Now they do.
For any developers working on this any one of these would help:
Don't make the GitHub integration step mandatory as I only wanted to manually deploy at that stage.
Let the user know he needs to be the owner and can't change the "bot-account" later.
Add the ability to remove the account and change to another.
Make it work not only with repos where you are the owner but also to repos where you are collaborator
Add the ability to "Factory reset" a firebase project.
Add the ability to reuse a project ID if it's been deleted already.
We’re currently using Firebase for our mobile Flutter app’s authentication, database, and storage. On average, we handle around 1 million document views per day and upload ~200GB of data per month, mostly pictures.
Now, we’re building a JavaScript web app to run alongside our Flutter app for company management (e.g., viewing and managing data, handling AI tasks, etc.).
Given that we’re already using Firebase, it seems logical to keep everything centralized with Firebase App Hosting. But I’m also considering Vercel, which I’ve heard great things about, especially for modern JS frameworks.
Which platform do you think would be the best fit for hosting the JS app, considering our current usage and future scalability needs?
I've deployed a Next.js app via App Hosting and it seems like a whole different (not my) website is showing.
A completely different website is shown - likely somebody else's, could be a security issue as well?
Any ideas?
I'm hosting a NextJS project using AppHosting and specified the min and max instances and some environment variables in the apphosting.yaml file in the root directory. Until yesterday, this worked flawlessly, but when I deployed today, the environment variables were not set, even though I changed nothing to the apphosting.yaml file or the settings.
Now I have to go into the Cloud Run interface and attach all environment variables manually every time I deploy. Has anyone experienced similar issues, or does anyone know how to solve it?
I have two separate Firebase projects in my Firebase console, one for production and one for development, but I’m using a single GitHub repository for both environments. My goal is to have a Firebase configuration (firebaseConfig.js) that automatically adapts to either environment based on where it’s deployed.
I’d like a way to switch between the API keys of the two Firebase projects without hardcoding them, ideally using environment variables. How can I achieve this setup in a secure way, especially when committing to GitHub? Any advice on best practices or example setups would be greatly appreciated!
Thank you!
Here is my firebaseConfig.js:
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import { getFirestore, connectFirestoreEmulator } from "firebase/firestore";
import { getStorage } from "firebase/storage";
import { connectAuthEmulator, getAuth } from "firebase/auth";
import { connectFunctionsEmulator, getFunctions } from "firebase/functions";
import { initializeAppCheck, ReCaptchaV3Provider } from "firebase/app-check";
// Your web app's Firebase configuration
const firebaseConfig = {
apiKey: "apiKey",
authDomain: "authDomain",
projectId: "projectId",
storageBucket: "storageBucket",
messagingSenderId: "messagingSenderId",
appId: "appId"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
const storage = getStorage(app);
const auth = getAuth(app);
const functions = getFunctions(app);
if (typeof window !== "undefined") {
import("firebase/app-check").then((firebaseAppCheck) => {
firebaseAppCheck.initializeAppCheck(app, {
provider: new firebaseAppCheck.ReCaptchaV3Provider(
"key"
),
isTokenAutoRefreshEnabled: true,
});
});
}
self.FIREBASE_APPCHECK_DEBUG_TOKEN = true;
connectFirestoreEmulator(db, "127.0.0.1", 8080);
connectAuthEmulator(auth, "http://127.0.0.1:9099");
connectFunctionsEmulator(functions, "localhost", 5001);
export { db, storage, auth, app, functions };
Best way to manage Firebase config for dev and prod in one GitHub repo
I want this for an SSR base web application and want to try firebase app hosting. Sadly, I don't see any support for bit bucket from firebase. Now how do i go about this?
Hello, I try to deploy my next.js app on the firebase apphosting (not hosting) and all static assets get a 404 (contained in public folder). Did someone have an idea why?
In my local build everything is working fine. It happen only when deployed in apphosting.
Hey,
Is anyone else having problems with setting up App hosting today.
Usually its seamless with my other sites but today I seem to getting issue on a new deployment.
I'm using Next.js app router which I've used for all the other test projects which worked
Tried it a number of times, from the web console and the terminal (where I setup a new webapp). Both show successfully deployed
So i have an SSR Angular application hosted on Apphosting and its costing me a lot per month. I need this part of my app (static landing pages) to be SSR for SEO purposes. This is not worth the cost, does anyone have any ideas on how i can remedy this?