Skip to content
MyAppBuilder
StableState

Session (current user)

Overview

Who is using the app right now: signed-in app user or anonymous visitor, with id, email, name and role.

Purpose

Personalisation, ownership and access: greet the user, store Current user › email as the owner of new records, show staff-only parts, and let own-records rules filter data.

Inputs

  • Nothing to configure in the app — it comes from the app's authentication (sign-in, magic link, Google). In the builder, Preview as simulates a role and email.

Configuration

  • Enable authentication and choose the default role for new sign-ups under Authentication.
  • Use the Sign in / Sign out actions and the Login Form component to manage the session; pages with Requires sign-in redirect visitors automatically.

Outputs

  • Current user › id / email / name / role / isAuthenticated in the Data Picker; {{user.email}} etc. in templates. Visitors: empty values, role “Public”, isAuthenticated false.

Example

Greeting and ownership

Example
Heading › Text: Hello {{user.name}}
Form › On submit: Create record  Jobs  (Also set: Owner = Current user › email)

Errors

  • After the session expires, the app shows the configured Session expired page or the sign-in screen with a message.

Limitations

  • Read-only: you cannot change the user from actions.
  • Values the browser sends are never trusted for permissions — the server re-checks the session on every data request.

Advanced

  • CurrentUser = { id, email, name, role, roleId, isAuthenticated }; ANONYMOUS has roleId: "role_public". Server side: resolveRuntime(req, projectId, channel) resolves the app user per channel (draft → preview role, staging/live → app session).

Related

Was this helpful?