# Client code: before / after (generic patterns)

Generated 2026-09-19T16:11:28-06:00. Each Base44 entity call has one supabase-js equivalent; the review pass replaces them one pull request at a time.

| Base44 (before) | Supabase (after) |
|---|---|
| `base44.entities.Customer.list()` | `supabase.from('customer').select('*')` |
| `base44.entities.Customer.create(data)` | `supabase.from('customer').insert({ ...data, owner_id: user.id })` |
| `base44.entities.Order.filter({ status: 'open' })` | `supabase.from('order').select('*').eq('status', 'open')` |
| `base44.entities.Note.update(id, patch)` | `supabase.from('note').update(patch).eq('id', id)` |
| `base44.auth.me()` | `supabase.auth.getUser()` |
| `base44.auth.login()` (hosted) | `supabase.auth.signInWithOAuth({ provider })` or `signInWithPassword` |

Row-level security replaces the old per-request ownership checks: every table carries `owner_id` and the policies in `migration.sql`.
Environment: `SUPABASE_URL`, `SUPABASE_ANON_KEY` in the client; the service-role key only in the import step, never shipped.
