Add a backend to a Swift app
A Swift app uses the supabase-swift package, which works with Scribase unchanged. Create the project in the console, copy two values, and generate Codable types for your tables.
1.Create the backend
Sign up in the console. Your first project is created automatically and the "Your backend is live" screen shows the Project URL and the publishable key with one-click copy.
2.Add the package
In Xcode: File, Add Package Dependencies, then this URL. Or add it to Package.swift.
.package(url: "https://github.com/supabase/supabase-swift.git", from: "2.55.0")3.Create the client
The URL and the publishable key are public by design; row-level security protects the data.
import Supabase
let supabase = SupabaseClient(
supabaseURL: URL(string: "https://acme-my-app-production-c2b0ea0a.scribase.com")!,
supabaseKey: "<publishable key>"
)4.Create your first table
Open your project in the console, go to Editor, then SQL, and run this. Or ask your coding agent: with the Scribase MCP server connected it applies the same SQL as a migration. Row-level security is on, so the public key can only read what the policy allows.
create table public.todos (
id bigint generated always as identity primary key,
title text not null,
done boolean not null default false,
created_at timestamptz not null default now()
);
alter table public.todos enable row level security;
create policy "todos are readable" on public.todos
for select to anon, authenticated using (true);
insert into public.todos (title) values ('Ship the backend'), ('Tell a friend');5.Generate Codable types
One Row, Insert and Update struct per table, from the live schema. Re-run after schema changes.
scribase gen types <org> <project> production --lang swift --out Sources/App/DatabaseTypes.swift6.Query with the types
Rows decode into the generated structs.
let todos: [TodosRow] = try await supabase.from("todos").select().execute().valuePaste this into Claude Code, Cursor or Codex
The agent runs init, asks you to approve once in the browser, creates the table and wires up the first screen.
Add a Scribase backend to this Swift app.
1. Add the supabase-swift package (https://github.com/supabase/supabase-swift.git, from 2.55.0).
2. Create a SupabaseClient from the project URL and publishable key; read both from the app configuration, never hard-code the service role key.
3. Create a `todos` table with row-level security on and a read policy using the Scribase MCP server or a SQL migration.
4. Run `scribase gen types <org> <project> production --lang swift` into the app and list the todos in a SwiftUI view.Connect the MCP server first so the agent can run SQL safely: setup for Claude Code, Codex or Cursor.
Common questions
Do sign-in with Apple and passkeys work?
Yes. Turn them on for the environment in the console; supabase-swift calls the same auth endpoints.
Your Swift (iOS and macOS) backend, live in a minute
$25 a month per project, flat. Sign up with one click; the $1 card check is credited to your first invoice.
Start now