Overview
SuperTokens Core provides comprehensive user management with support for multiple authentication methods per user, account linking, and user ID mapping for external identity systems.User Types
Recipe User vs Primary User
SuperTokens distinguishes between two types of users:Recipe User
A user authenticated through a single method (email/password, social login, etc.)
Primary User
A user with multiple authentication methods linked together
Creating Users
Email/Password Users
Third-Party (Social) Users
Passwordless Users
Account Linking
Making a User Primary
Before linking accounts, you must designate one as primary:Linking Accounts
Link a recipe user to a primary user:Account Linking Checks
From AuthRecipe.java, SuperTokens validates:1
Primary User Validation
Ensure the primary user ID corresponds to an actual primary user
2
Recipe User Validation
Verify recipe user isn’t already linked to another primary user
3
Conflict Detection
Check for account info conflicts (email, phone, third-party ID)
4
Tenant Consistency
Verify both users share at least one tenant
Unlinking Accounts
User Retrieval
Get User by ID
Get Multiple Users
Get User by Email
Get User by Phone Number
Get User by Third-Party Info
Pagination
List Users with Pagination
The maximum pagination limit is 500 users per request.
Updating User Information
Update Email
Update Password
Update Phone Number
User Deletion
Delete User
Deletes user and all associated data:User ID Mapping
External User IDs
Map SuperTokens user IDs to your existing system:Using External IDs
Once mapped, you can use external IDs in most operations:Email Verification
Generate Verification Token
Verify Email
Check Verification Status
Unverify Email
Multi-Tenant User Management
Associate User with Tenant
Disassociate User from Tenant
List User’s Tenants
User Search
Search by Email
Search by Dashboard Tags
Active Users Tracking
Track when users were last active:Active user tracking is updated automatically during session operations.
User Count
Best Practices
Use Primary Users
Link accounts to provide seamless multi-method authentication
Handle Edge Cases
Always check for null returns and handle exceptions
Verify Emails
Implement email verification for security
Map External IDs
Use ID mapping to integrate with existing systems