Configuration
SuperTokens Core is configured using aconfig.yaml file and environment variables. This page documents all available configuration options.
Configuration file location
The default configuration file is located at:--with-config flag:
Core configuration
Service settings
The port on which SuperTokens Core runs
The host on which SuperTokens Core runs. Can be
localhost, a domain name, 0.0.0.0, or an IP addressBase path to prepend to all API endpointsWith this config, endpoints become
/auth/recipe/signup instead of /recipe/signupMaximum thread pool size for incoming HTTP requests
Logging
Path for INFO level logs. Set to
"null" to log to standard outputPath for ERROR level logs. Set to
"null" to log to standard errorLogging level. Options:
DEBUG, INFO, WARN, ERROR, NONEAuthentication configuration
Access tokens
DIFFERENT_ACROSS_APPS: Time in seconds for access token validity
DIFFERENT_ACROSS_APPS: Time in hours for signing key rotation
Shorter intervals improve security but increase database queries for key management
Refresh tokens
DIFFERENT_ACROSS_APPS: Time in minutes for refresh token validity
API keys
DIFFERENT_ACROSS_APPS: Comma-separated API keys for authenticating Backend SDK requests
Password authentication
Password hashing
DIFFERENT_ACROSS_APPS: Password hashing algorithm. Options:
BCRYPT, ARGON2BCrypt settings
Number of rounds for BCrypt hashing. Higher values are more secure but slower
Argon2 settings
Number of iterations for Argon2 hashing
Memory usage in KB for Argon2 (default: 85 MB)
Parallelism factor for Argon2
Number of concurrent Argon2 hash operations allowed
Password reset
DIFFERENT_ACROSS_TENANTS: Password reset token lifetime in milliseconds
Passwordless authentication
DIFFERENT_ACROSS_TENANTS: Passwordless code validity in milliseconds
DIFFERENT_ACROSS_TENANTS: Maximum code input attempts before requiring restart
TOTP (MFA)
DIFFERENT_ACROSS_TENANTS: Maximum invalid TOTP attempts before rate limiting
DIFFERENT_ACROSS_TENANTS: Rate limit duration in seconds after max attempts reached
Email verification
DIFFERENT_ACROSS_TENANTS: Email verification token lifetime in milliseconds
IP filtering
DIFFERENT_ACROSS_TENANTS: Regex pattern for allowed IP addresses
DIFFERENT_ACROSS_TENANTS: Regex pattern for denied IP addresses
OAuth configuration
Encryption key for OAuth client secrets stored in database
URL for OAuth provider public service
URL for OAuth provider admin service
SAML configuration
Service provider entity ID for SAML
Duration in milliseconds for SAML claims validity
Bulk import
DIFFERENT_ACROSS_APPS: Number of parallel threads for bulk user migration
DIFFERENT_ACROSS_APPS: Number of users to load per batch during migration
Monitoring
OpenTelemetry collector URL for distributed tracing
Enable deadlock detection logging
Environment variables
Most configuration options can be set via environment variables using uppercase with underscores:Environment variables take precedence over config.yaml settings
Configuration scopes
Configuration parameters are marked with scope annotations:- DIFFERENT_ACROSS_APPS: Can be different for each app in multi-tenancy setup
- DIFFERENT_ACROSS_TENANTS: Can be different for each tenant within an app
- (No annotation): Global configuration, same across all apps and tenants
Example configurations
Development
config.yaml
Production
config.yaml
High security
config.yaml
Validation
Validate your configuration by starting SuperTokens Core:Related documentation
Database setup
Configure your database connection
Docker deployment
Use environment variables with Docker
Self-hosting
Deploy SuperTokens Core to production
Security
Learn about security best practices