14. Identity, State & App
context.user
sync· returnsobject | null
The signed-in app user (not the platform builder). Alias of context.app.user.
const me = context.user;
if (!me) {
context.toast.error("You are not signed in.");
return;
}
console.log(me.email, me.id, me.role);Shape
{
"id": "7",
"email": "john.smith@company.com",
"firstName": "John",
"lastName": "Smith",
"role": "admin",
"roleId": "2",
"roleName": "Admin"
}There is no context.user.FullName
Identity fields are camelCase (firstName, lastName, email, id). The old record-shaped { ID, FullName, Email, RoleId } object is gone.
For the raw session (token, isAuthenticated), use context.sessions.app.
context.appState
sync
A runtime key-value store scoped to the current page. Use it to share transient data between processes on the same page without writing to the database. set does not re-render the page.
Prop
Type
context.appState.set("selectedItemId", "42");
const id = context.appState.get("selectedItemId");The old context.state.foo = value assignment does not exist.
context.app.primaryColor
sync· returnsstring
The application's primary theme colour as a hex string.
const color = context.app.primaryColor;
/* "#258bc3" */