Skip to content
Blog

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.

Every user gets a unique id at sign-up. Beyond that, the available fields depend on how they authenticated:

FieldWhen availableDescription
idAlwaysUnique user ID
emailEmail/password, magic linkThe user’s email address
pseudonymousIdSocial login, wallet, GoogleA hashed identifier that protects the user’s real identity
walletAddressWallet loginSolana wallet public key
authMethodAlwaysThe method used to sign in

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
}

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 pseudonymousId on your site

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

You can configure your site in one of two modes, depending on whether you’re building something open or restricted:

ModeBehavior
publicAnyone can register and log in
internalOnly 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
}