# Ionic Supabase

> Wire Supabase Auth and Postgres database into an Ionic Capacitor app via the @supabase/supabase-js client. Trigger when adding Supabase Auth (email, magic link, Google, Apple), Postgres queries, realtime subscriptions, or storage to an Ionic app.

- Skill: `erkamyaman/ionic-supabase` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add erkamyaman/ionic-supabase`
- Raw SKILL.md: https://api.skillmd.com/api/skills/erkamyaman/ionic-supabase/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- License: MIT
- Author: erkamyaman (https://skillmd.com/u/erkamyaman)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/erkamyaman/ionic-supabase

---


# Supabase

Open-source Firebase alternative: Postgres + GoTrue auth + Realtime + Storage. Same shape as `ionic-firebase` but Postgres-flavored — pick this when your team prefers SQL, RLS, or self-hosting.

## When to consult

- **Project setup + client init**: [setup.md](references/setup.md)
- **Auth** (email, magic link, OAuth, native Apple/Google): [auth.md](references/auth.md)
- **Database** (queries, RLS, realtime): [database.md](references/database.md)
- **Per-framework integration**: [framework-snippets.md](references/framework-snippets.md)

## Hard rules

- ✅ The **anon key** is publishable — safe to ship in the bundle. Row Level Security (RLS) does the gating.
- ✅ The **service role key** is a secret — NEVER ship it; server-side only.
- ✅ **Enable RLS on every table** that holds user data. Without RLS, anon-key clients can read/write everything.
- ✅ Native OAuth (Google / Apple) on mobile uses `signInWithOAuth({ skipBrowserRedirect: true })` + your app's deep-link scheme. The default web flow doesn't return cleanly to a native app.
- ❌ Don't store JWTs in `localStorage` if you can avoid it — use `@capacitor/preferences` via the Supabase storage adapter (see setup.md).

## Library

```bash
npm install @supabase/supabase-js
```

No native plugin required — the JS client works in WKWebView / Android WebView and uses HTTPS only.

