Add app sign-in
App sign-in is for the people who use your app, with the accounts in your Supabase project. It is separate from your Ynch account. It needs a Supabase connection.
1. Declare it
Section titled “1. Declare it”In .ynch/connections.json, add userAuth and name the field that holds the user’s id on your tables:
{ "schemaVersion": "1.0.0", "connections": { "primary": { "cloudConnectionId": "conn_main", "provider": "supabase", "userAuth": { "userColumn": "user-id" } } }}user-id here means the database column user_id.
2. Use the column in your models and operations
Section titled “2. Use the column in your models and operations”For a table that holds per-user rows, include the user field in the model and in the operation’s columns. For example, a progress table with user_id:
- When the app reads, Studio adds a filter so a user only gets rows where
user_idis their own id. - When the app inserts, Studio fills
user_idwith the signed-in user’s id. The app cannot set it to someone else’s.
Requests also carry the user’s own Supabase session, so your row level security policies (for example auth.uid() = user_id) apply as they would in any Supabase app.
3. Upload and accept
Section titled “3. Upload and accept”Upload, approve and activate as usual. Studio then shows Database settings have changed: accepting turns app sign-in on and approves the operations in one step.
What users see
Section titled “What users see”When the app needs a signed-in user, it shows a sign-in screen with email and password. The session is kept in the iPhone’s Keychain and renewed automatically. The app’s detail screen in Ynch has a sign-out row.
Limits today
Section titled “Limits today”- Supabase only.
- Email and password sign-in for existing accounts. Sign-up and password reset happen in your own Supabase flows.