Users & Roles
Tribe maintains a complete user directory for every site. You can browse it in the dashboard, assign roles to control what people can do, and manage sessions across devices. The identity system is built around privacy-preserving identifiers, so users who sign in through social providers or wallets don’t end up with their real-world identity stored on your behalf.
User identity
Section titled “User identity”Every user gets a unique id at sign-up. Beyond that, the available fields depend on how they authenticated:
| Field | When available | Description |
|---|---|---|
id | Always | Unique user ID |
email | Email/password, magic link | The user’s email address |
pseudonymousId | Social login, wallet, Google | A hashed identifier that protects the user’s real identity |
walletAddress | Wallet login | Solana wallet public key |
authMethod | Always | The method used to sign in |
Displaying user identity
Section titled “Displaying user identity”When your app supports multiple auth methods, you’ll want a fallback chain for display names:
const displayName = user.email ?? user.walletAddress ?? user.pseudonymousId?.slice(0, 12) + "...";You can assign a role to any user, and that role string travels with them through the session and into the JWT:
import { Tribe } from "@tribecloud/sdk";
const user = await tribe.setRole("admin");// user.role is now "admin"Tribe stores the role but doesn’t enforce it. That’s deliberate. Your application decides what each role means and gates access accordingly:
const session = await tribe.getSession();if (session?.user.role === "admin") { // Show admin panel}Because the role is also embedded in the userToken JWT, your backend can make the same check server-side:
const decoded = verifyUserToken(token, tribeKey);if (decoded.role === "admin") { // Allow admin operations}Privacy model
Section titled “Privacy model”For auth methods that don’t involve an email (social login, wallet, Google Sign-In), Tribe never stores the raw identity. Instead it stores a one-way hash:
pseudonymousId = SHA256(provider + ":" + userId + ":" + siteSalt)What does this actually get you?
- No real email or identity lives on Tribe’s servers
- Even if the database were compromised, user identities stay protected
- Each site uses its own salt, so a single person on two different Tribe-powered sites will have two entirely different pseudonymous IDs
- The hash is deterministic, meaning the same user always produces the same
pseudonymousIdon your site
Dashboard
Section titled “Dashboard”The Tribe dashboard gives you a full view of your user base:
- All users with their IDs, auth methods, and assigned roles
- Session and device history for each user
- Activity and event logs
Access modes
Section titled “Access modes”You can configure your site in one of two modes, depending on whether you’re building something open or restricted:
| Mode | Behavior |
|---|---|
public | Anyone can register and log in |
internal | Only organization members can register and log in |
You can check the current mode from the SDK if you need to adapt your UI:
const config = await tribe.getAuthConfig();if (config.accessMode === "internal") { // Adapt UI for internal-only access}