Firebase Authentication is powerful but was designed in an era before SwiftUI and modern Swift concurrency. This creates a significant architectural mismatch for modern iOS apps. After building several applications with it, I repeatedly encountered the same pain points:
- Architectural Mismatch with SwiftUI: Firebase's imperative, singleton-based APIs are fundamentally incompatible with SwiftUI's declarative, state-driven nature. This forces developers to write complex, bug-prone bridging code.
- "Callback Hell": The SDK relies heavily on nested completion handlers (callbacks), which are difficult to reason about and lead to unmaintainable code, a problem that modern
async/awaitis designed to solve. - Account Linking Complexity: The multi-step account linking flow is managed through callbacks and global state, making it extremely difficult to represent cleanly in a SwiftUI view hierarchy.
- Untestable by Design: The heavy use of global singletons (
Auth.auth()) makes the SDK nearly impossible to mock, preventing isolated and reliable unit testing of an app's authentication logic. - Generic Error UX: Firebase returns cryptic error codes (e.g.,
invalid-credential) that confuse users instead of guiding them toward a solution.
The goal was to create a modern adapter or bridge—a reusable library that translates Firebase's difficult APIs into a system that feels truly native to SwiftUI and Swift Concurrency.