Tribe handles login, registration, and session management in a single integration. You can get up and running in minutes with pre-built hosted pages, or wire up your own custom forms when your design calls for it. The choice comes down to how much control you want over what users see.
Redirect users to Tribe’s hosted login and registration pages. There’s no UI code to write on your end: call redirectToLogin(), and Tribe handles the rest.
Best for: Getting authentication working quickly, or when a custom design isn’t a priority.
Build your own login and registration forms with tribe.login() and tribe.register(). You own the entire UI while Tribe manages sessions and security behind the scenes.
Best for: Apps where authentication needs to match your brand’s look and feel.
After a user logs in through any method, the SDK stores a session token in localStorage. You can check for an active session on each page load:
const session = await tribe.getSession();
if (session) {
console.log("Logged in as:", session.user.id);
console.log("User token:", session.userToken); // JWT for backend verification
} else {
console.log("Not logged in");
}
The userToken is a JWT signed with your site’s TRIBE_KEY. You can verify it on your backend to confirm the user’s identity without making a network call back to Tribe.
For auth methods that don’t involve email (social login, wallet, Google Sign-In, passkeys), Tribe stores only a pseudonymous hash derived from the provider’s user ID and a per-site salt. The user’s real email and identity never touch the database.
In practice, this means user.email will be null for these users, and user.pseudonymousId serves as the stable identifier you should use in your app. Even if the database were breached, real identities would remain protected because the hash can’t be reversed without the original provider ID.
Passkeys fit naturally into this privacy model. Since WebAuthn credentials are bound to the user’s device and domain, they don’t expose any external identity at all. Combined with session verification, passkeys also let you protect accounts against suspicious logins from unrecognized devices, without requiring users to hand over an email address or phone number.
Sessions & DevicesManage active sessions, view logged-in devices, and revoke sessions on other browsers.
Multi-Factor RecoveryGive users multiple independent ways to recover their account so losing one login method doesn't mean losing everything.
Backend VerificationVerify user tokens on your server using TRIBE_KEY, with no network call back to Tribe.