Aurabase News

Aurabase - The European alternative to Supabase, a Backend as a Service

A practical Expo auth and push-notification stack with Aurabase

Use Aurabase for identity and app data, Expo for the mobile notification flow, and verify the delivery boundary before shipping.

Illustration principale : A practical Expo auth and push-notification stack with Aurabase — Aurabase News
By Baptiste Morel·November 7, 2026·4 min read
What matters here
  1. Keep Expo push tokens in a user- and device-scoped table, not in a shared client-side record.
  2. Aurabase offers authentication and notifications, but its listed facts do not confirm Expo push-token delivery support.
  3. Test session restoration and notification delivery on physical iOS and Android devices before release.

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.

Start with the identity boundary

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.

Register devices as user-owned records

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.

Separate token storage from push delivery

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.

Test the awkward cases before release

  • Permission denied: the app must continue to work without a token.
  • Account switch: signing out must stop future sends to the old account’s device, according to your chosen policy.
  • Token rotation: a refreshed token must replace or deactivate the old record.
  • Duplicate events: retries must not create a burst of duplicate transactional messages.
  • Real devices: test on physical iOS and Android devices, with the production build configuration you intend to ship.

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.

More from Aurabase News