Skip to content
PraxivaraPraxivaraDocs
Websites Accounts Users in code

Managing users from your website

The admin calls a website can make to list users, invite people, change roles and disable accounts, and the profile calls every signed-in user has.

Updated Dec 2, 2026 ET 1 min read
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 website with no active admin.

JavaScript
import { auth } from "@praxivara/sdk";

const users = await auth.listUsers();                       // [{ id, email, display_name, role, status, created_date, last_login_at }]
await auth.inviteUser({ email, role: "user" });              // emails a link to join
await auth.setUserRole(id, "admin");                          // "admin" | "user"
await auth.setUserStatus(id, "disabled");                     // "active" | "disabled"

The invite email carries a link to set a password or, when only Google sign-in is on, a link to continue with Google. Invites need the website to be published and not private. Setting someone who is waiting for approval to active lets them in.

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 website 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 website 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?

Related articles