Journal

Raw Firebase Auth in SwiftUI Without the SDK

You can use Firebase Auth without the SDK by calling its REST API directly. It is lighter and dependency-free, but you take on the token handling the SDK did.

Raw Firebase Auth in SwiftUI Without the SDK: a reflective 3D App Store icon on a blue and purple gradient

TL;DR

Firebase Authentication exposes a REST API, so you can sign users in from SwiftUI without adding the Firebase SDK: fewer dependencies, a smaller app, and full control over the networking. The tradeoff is that you handle what the SDK did, sending the right requests, storing the ID and refresh tokens securely in the keychain, and refreshing them before they expire. Build the auth screen from a free VP0 design, and choose this path when you want minimal dependencies, the SDK when you want convenience.

Want Firebase Authentication in SwiftUI without dragging in the whole SDK? The short answer: call its REST API directly. You send sign-in requests, get back an ID token and a refresh token, and manage them yourself, which means a lighter app with fewer dependencies and full control, at the cost of doing the token work the SDK normally hides. Build the auth screen from a free VP0 design, the free iOS design library for AI builders.

Who this is for

This is for SwiftUI builders who want Firebase Auth but would rather not add a large SDK and its dependencies, and who are comfortable handling tokens themselves in exchange for a smaller, more controlled app.

What you take on without the SDK

Firebase Authentication ships an Auth REST API, so signing up and signing in is just HTTPS requests with your project’s API key, returning an ID token (short-lived) and a refresh token (long-lived). The SDK normally manages three things for you, and now you own them. First, the requests: the right endpoints for sign-up, sign-in, and password reset. Second, secure storage: the ID and refresh tokens belong in the keychain, never in plain UserDefaults. Third, refresh: the ID token expires in about an hour, so you exchange the refresh token for a new one before it does, keeping the session alive. Done carefully, this is a clean, dependency-free auth layer.

ConcernSDK does itYou do it (REST)
Sign in or upMethod callHTTPS request with API key
TokensStored and managedStore in keychain yourself
RefreshAutomaticCall refresh before expiry
App sizeLargerSmaller, no dependency
ControlConvenientFull

Build it free with a VP0 design

Pick a login design from VP0, copy its link, and prompt your AI builder:

Rebuild this VP0 login design in SwiftUI using the Firebase Auth REST API, no SDK: [paste VP0 link]. Send sign-up and sign-in requests with the API key, store the ID and refresh tokens in the keychain, and refresh the ID token before it expires. Show clear loading and error states from the API responses, and include Sign in with Apple if I offer other social logins.

The payoff is a leaner, faster app, which matters because Google found 53% of visits are abandoned when an experience is slow, and every dependency adds weight and startup cost. For neighboring auth and backend patterns, see a Firebase iOS auth login with dark mode, a Supabase auth screen template for iOS, an Apple sign-in template in React Native, and a GDPR-compliant SwiftUI login. For a native file feature next, see an iOS document picker UI customization in SwiftUI.

Convenience versus control

Be honest about the tradeoff rather than dogmatic. The SDK exists because token refresh, persistence, and provider flows are fiddly, and for most apps the convenience is worth the size. The REST path is the right call when you want minimal dependencies, a smaller binary, or precise control over networking, and you are willing to own token storage and refresh correctly. Whichever you choose, keep tokens in the keychain, never log them, refresh before expiry, and add Sign in with Apple alongside any other social login. Do that and SDK-free auth is solid, not risky.

Common mistakes

The first mistake is storing tokens in plain storage instead of the keychain. The second is not refreshing the ID token before it expires, logging users out. The third is hardcoding or exposing the API key insecurely. The fourth is skipping Sign in with Apple when other social logins are offered. The fifth is paying for an auth kit when a free VP0 design plus the REST API does it.

Key takeaways

  • Firebase Auth has a REST API, so you can skip the SDK for a lighter app.
  • You take on token storage and refresh that the SDK normally handles.
  • Keep ID and refresh tokens in the keychain and refresh before expiry.
  • Choose REST for minimal dependencies, the SDK for convenience.
  • Build the screen free from a VP0 design.

Frequently asked questions

How do I use Firebase Auth without the SDK in SwiftUI? Call the Firebase Auth REST API with your API key, receive the ID and refresh tokens, store them in the keychain, and refresh the ID token before it expires, from a free VP0 design.

What is the safest way to build SDK-free auth with Claude Code or Cursor? Start from a free VP0 design, call the REST endpoints, store tokens in the keychain, refresh before expiry, handle API errors, and include Sign in with Apple.

Can VP0 provide a free SwiftUI or React Native template for a login screen? Yes. VP0 is a free iOS design library; pick a login design and your AI tool rebuilds the screen and states while you wire the Firebase REST calls.

Should I use the Firebase SDK or the REST API? The SDK for convenience and automatic token handling; the REST API for a smaller app, fewer dependencies, and full control, accepting that you manage tokens yourself.

Frequently asked questions

How do I use Firebase Auth without the SDK in SwiftUI?

Call Firebase Authentication's REST API directly: send sign-up and sign-in requests with your API key, receive the ID token and refresh token, store them securely in the keychain, and refresh the ID token before it expires using the refresh endpoint. Build the auth screen from a free VP0 design and handle errors from the API responses.

What is the safest way to build SDK-free auth with Claude Code or Cursor?

Start from a free VP0 design and call the Firebase Auth REST endpoints, storing the ID and refresh tokens in the keychain, never in plain storage. Refresh tokens before expiry, handle API error codes with friendly messages, and include Sign in with Apple if you offer other social logins.

Can VP0 provide a free SwiftUI or React Native template for a login screen?

Yes. VP0 is a free iOS design library for AI builders. Pick a login design, copy its link, and your AI tool rebuilds the email and password screen and states at no cost while you wire the Firebase REST calls.

Should I use the Firebase SDK or the REST API?

Use the SDK for convenience: it handles token refresh, persistence, and providers for you. Use the REST API when you want a smaller app, fewer dependencies, and full control over networking, accepting that you must manage token storage and refresh yourself. Both are valid; it is a convenience-versus-control tradeoff.

Part of the Backend, Auth & Data Integrations hub. Browse all VP0 topics →

Keep reading

Firebase iOS Auth Login With Dark Mode (Free SwiftUI): the App Store logo as a glossy glass icon on a purple and blue gradient with floating bubbles
Guides 4 min read

Firebase iOS Auth Login With Dark Mode (Free SwiftUI)

Build a Firebase auth login screen in SwiftUI with proper dark mode: email, social sign-in, and Sign in with Apple, from a free VP0 design.

Lawrence Arya · May 31, 2026
Supabase Auth Screen Template for iOS (Free SwiftUI): the App Store logo as a frosted glass icon on a pink and blue gradient with bubbles
Guides 4 min read

Supabase Auth Screen Template for iOS (Free SwiftUI)

Build a Supabase auth screen in SwiftUI: email, magic link, social sign-in, and Sign in with Apple, from a free VP0 design. With row-level security.

Lawrence Arya · May 31, 2026
App Tracking Transparency Prompt UI in SwiftUI: a glass app tile showing the VP0 logo on a pink and blue gradient
Guides 4 min read

App Tracking Transparency Prompt UI in SwiftUI

How to do the App Tracking Transparency prompt right in SwiftUI: prime it in context, ask at the correct moment, and keep the app working when the user says no.

Lawrence Arya · June 2, 2026
iOS Address Autocomplete: Google Places or Free MapKit: a glass photo icon surrounded by chat, music, heart, camera and shopping app icons on a pastel gradient
Guides 4 min read

iOS Address Autocomplete: Google Places or Free MapKit

How to build an address autocomplete UI for iOS with the Google Places API, plus MKLocalSearchCompleter, the free native alternative built into MapKit.

Lawrence Arya · June 2, 2026
Build a Language Learning App Like Duolingo in SwiftUI: the App Store logo on a glass tile over a blue gradient with bubbles
Guides 4 min read

Build a Language Learning App Like Duolingo in SwiftUI

A free SwiftUI pattern for a language learning app: a lesson path, exercise types, spaced repetition, and forgiving streaks. Learn the pattern, not the brand.

Lawrence Arya · June 2, 2026
Native In-App Purchases in SwiftUI Without RevenueCat: a glass iPhone app-grid icon on a mint and teal gradient
Guides 4 min read

Native In-App Purchases in SwiftUI Without RevenueCat

How to build in-app purchases in SwiftUI with StoreKit 2 directly, no RevenueCat: the tradeoffs, the compliance rules, and what you own server-side.

Lawrence Arya · June 2, 2026