Managing users from your app
The admin calls an app can make to list users, invite people, change roles and disable accounts, and the profile calls every signed-in user has.
Last updated September 17, 2026
On this page
For a team tool or a CRM the builder makes a Team page around these calls. Each admin call refuses anyone who is not a signed-in admin, and the platform never allows a change that would leave the app with no active admin.
JavaScript
import { auth } from "@praxivara/sdk";
const users = await auth.listUsers(); // [{ id, email, display_name, role, status, created_date }]
await auth.inviteUser({ email, role: "user", message }); // emails a set-password link
await auth.setUserRole(id, "admin"); // "admin" | "user"
await auth.setUserStatus(id, "disabled"); // "active" | "disabled"What every signed-in user can do
JavaScript
const me = await auth.me(); // null when signed out
await auth.updateMyUserData({ display_name: "Ana", data: { plan: "pro" } });
auth.logout();data is a small free-form object for things your app wants to remember about the person: preferences, a plan name, an onboarding step.
Sign-in calls
JavaScript
await auth.register(email, password, displayName);
await auth.login(email, password);
auth.loginWithGoogle({ returnTo: "/dashboard" });
const result = await auth.googleSignInResult(); // after a Google round-trip
await auth.forgotPassword(email);
await auth.resetPassword(token, newPassword);
const { email: emailOn, google: googleOn } = await auth.methods();Reading the session in a page
Pages read the session through the platform's session helpers rather than calling auth.me() themselves, so the whole app loads it once:
JSX
import { useSession, RequireAuth } from "@/lib/session.jsx";
function Dashboard() {
const { user, isAdmin } = useSession();
return <h1>Welcome back, {user.display_name}</h1>;
}
<Route path="/dashboard" element={<RequireAuth><Dashboard /></RequireAuth>} />
<Route path="/admin" element={<RequireAuth roles="admin"><Admin /></RequireAuth>} />Asking is enough. You do not need any of this to get a Team page. "Add a team page where I can invite people, make someone an admin and disable an account" is the whole request.
Was this page helpful?