NewThe Flutter Kit — Flutter boilerplate$149$69
Integration · Pre-Wired · Production Code

Supabase + The Swift Kit — Auth, Database & Storage Pre-Wired

Email auth, Sign in with Apple, Postgres with Row Level Security, Storage buckets. Paste your Supabase URL and anon key, and ship.

Last updated: 2026-05-16 7 min read By Ahmed Gagan, iOS Engineer
Quick Answer

The Swift Kit ships Supabase end-to-end: email/password + magic link + Sign in with Apple auth flows, an @Observable session model that drives the entire app\'s auth state, a starter Postgres schema with Row Level Security policies, and Storage bucket helpers for image uploads. Paste your Supabase URL and anon key into Secrets.swift, run the included SQL migration once, and a complete authenticated iOS app compiles and runs.

Auth methods
Email, magic link, Apple Sign-In
Database
Postgres + RLS pre-configured
Storage
Bucket helpers for uploads
Setup time
~5 minutes

What's Pre-Wired

The Swift Kit ships these Supabase capabilities ready to use:

  • SupabaseClient configured at app launch from Secrets.swift
  • @Observable AuthModel binds to Supabase session changes
  • Email + password sign-up / sign-in / magic-link flows
  • Sign in with Apple → Supabase Auth integration
  • Sign out, password reset, account deletion flows
  • Starter Postgres schema (profiles table) with RLS policies
  • Storage helpers for image uploads (avatars, attachments)
  • Offline cache layer via SwiftData
  • Error handling + user-facing messages

Setup in 5 Minutes

After cloning Swift Kit:

Secrets.swift
enum Secrets {
  static let supabaseURL = "https://xxxxx.supabase.co"
  static let supabaseAnonKey = "eyJhbGc..."  // anon public key
  // ...rest of your keys
}

Reading Auth State Anywhere

AuthModel is in the environment — any view can react to session changes:

RootView.swift
struct RootView: View {
  @Environment(AuthModel.self) var auth

  var body: some View {
    if auth.isSignedIn {
      MainTabView()
    } else {
      SignInView()
    }
  }
}

Database Queries with RLS

Row Level Security means the database itself enforces "you can only see your own data." No server middleware needed.

TaskRepository.swift
// RLS policy on the database:
// CREATE POLICY "Users see own tasks" ON tasks
//   FOR SELECT USING (auth.uid() = user_id);

// In iOS code — no user_id filter needed; RLS handles it:
let tasks: [Task] = try await supabase
  .from("tasks")
  .select()
  .order("created_at", ascending: false)
  .execute()
  .value

Skip the backend setup.

Auth, database, storage — all pre-wired to Supabase in The Swift Kit.

Get The Swift Kit — $99

Frequently Asked Questions

How is Supabase integrated in The Swift Kit?
The Swift Kit ships Supabase fully pre-wired: auth (email, magic link, Sign in with Apple), Postgres database access via the Swift SDK, Row Level Security policies for the user model, and Storage bucket helpers for file uploads. You paste your Supabase URL and anon key into Secrets.swift, and the auth flow, database queries, and storage uploads all work.
Do I need to write SQL or set up RLS policies myself?
The Swift Kit ships a starter schema with user profiles and Row Level Security policies pre-defined. Migration SQL is included — run it once via the Supabase CLI or paste into the Supabase SQL editor. After that, queries from the iOS app are automatically scoped to the signed-in user.
Does Sign in with Apple work out of the box?
Yes. Apple Sign-In is fully wired to Supabase Auth — the Swift Kit handles the ASAuthorizationController flow, sends the identity token to Supabase, and persists the session. You only need to add the Sign in with Apple capability in Xcode and configure the bundle ID in Supabase Auth.
Can I use this with my own existing Supabase project?
Yes. Point Secrets.swift at your Supabase URL and anon key, run the included schema migration (or adapt it to your existing schema), and the kit works against your project. No vendor lock-in — the kit uses the standard Supabase Swift SDK.
What about offline / cached data?
The Swift Kit ships a lightweight cache layer for queries using SwiftData (iOS 17+) or UserDefaults for simpler cases. When offline, cached data renders; when online, queries refresh in the background. Customize the cache policy per query.
Is Supabase a real Firebase alternative?
Yes — Supabase is now the most-recommended Firebase alternative for iOS developers. Real Postgres SQL, RLS without server middleware, generous free tier (500MB DB, 50k MAU), open-source, no vendor lock-in. The Swift Kit makes the iOS integration trivial.

Keep exploring

Ship your iOS app 10× faster

The Swift Kit gives you a production-ready SwiftUI boilerplate — design system, paywall, auth, AI, all pre-wired. $99 one-time.

Get The Swift Kit — $99

One-time purchase · Lifetime updates · 14-day refund