BaaS : les types générés rapprochent la base de l’interface
Les versions annoncées des SDK d’Aurabase et la génération automatique des types remettent la synchronisation DB-to-UI au centre des choix BaaS.
Use Aurabase for identity and app data, Expo for the mobile notification flow, and verify the delivery boundary before shipping.
A mobile app can sign users in correctly and still send a notification to the wrong device. The risk is often in the glue: a token outlives a session, a user changes accounts on one phone, or the backend assumes that storing a token also delivers a push.
For an Expo React Native app, split those jobs. Use Aurabase for authentication and PostgreSQL-backed app data. Use Expo’s notification tooling to request permission and obtain a device token. Put token ownership and delivery behind a server-side boundary. That gives the app a clear place to connect identity to devices without treating the mobile client as a trusted sender.
Install @aurabase/aurabase-js and initialize the client with the project URL and client-appropriate key, following Aurabase’s current SDK documentation. Aurabase provides authentication and sessions, but do not guess method names or session-persistence options from a web example. Confirm that the SDK version and its documented React Native support match the Expo app you are building.
Build one small sign-in path first. After authentication, make a request for data that belongs to the signed-in user. Test a fresh install, an app restart, sign-out, and account switching. A session that works only until the app closes is not a finished mobile auth flow.
Set database permissions so a user can access only their own records. Do not rely on a screen hiding another person’s data; enforce ownership at the database or server boundary. If your sign-in uses a magic link, the important question is when the app treats the session as trusted. Aurabase’s guide to session trust in a magic-link and MFA flow is useful background on that boundary.
Add a device-token table in PostgreSQL rather than storing one token directly on a user row. A user may have more than one phone, and a phone may be signed out or used by a different account. A practical record includes the authenticated user ID, token, platform, creation or last-seen time, and an active state. Treat tokens as sensitive identifiers: expose them only where the app needs them.
In Expo, request notification permission at a point where the user understands why the app is asking. If permission is granted, obtain the token through Expo’s notification tooling, then submit it to a server-side registration path. Aurabase provides server functions; use one as the boundary if its current runtime and project configuration support the required request and database operations. Derive the user identity from the verified session, not from a user ID supplied in the request body.
Make registration safe to repeat. Upsert or otherwise deduplicate the user-and-device record, and deactivate or replace stale tokens when a device reports a change. The exact schema and write method are yours to choose; the key design rule is that a client cannot attach an arbitrary token to another user’s account.
Aurabase lists notifications among its backend services. The product facts available for this guide do not establish whether that service accepts Expo push tokens, sends to both mobile platforms, or exposes delivery receipts and retry controls. Do not infer a push transport from the word “notifications.” Verify those details in the current documentation before making it the delivery path.
If it supports the required Expo flow, route sends through that service and keep the provider credentials and send logic off the client. If it does not, add a delivery adapter on the server side that accepts the stored Expo token and uses a compatible push delivery service. Aurabase can still hold the user-to-device mapping and the business event that triggers a send. Keep the adapter narrow so a provider change does not force changes to sign-in or app screens.
For a transactional event, such as a completed booking, the app should not decide that the event happened merely because it is displaying a success screen. Have trusted server-side logic confirm the event, select active tokens for the user, and request delivery. Record enough status to investigate failures. Push delivery is not a guarantee that a person saw a message; the app should still show the underlying state when opened.
The trade-off is deliberate: Aurabase can centralize identity, relational data, and server-side logic, while Expo handles the app-side notification permission and token flow. But delivery compatibility and operational behavior still need verification. Confirm that boundary early, then build the smallest end-to-end path: sign in, register one device, trigger one server-confirmed event, and verify what arrives.
Les versions annoncées des SDK d’Aurabase et la génération automatique des types remettent la synchronisation DB-to-UI au centre des choix BaaS.
Comparez une pile Postgres auto-hébergée à un BaaS sur le même périmètre, en comptant l’infrastructure et le temps d’exploitation.
Un protocole de test permet de comparer démarrage, mémoire et coût sans confondre gains du runtime et effets du réseau ou de la base.