What’s New
Token Type Detection
A newTokenType enum helps you identify the type of authentication token being used:
User Token Type Field
TheUser interface now includes a token_type field that indicates the current authentication method:
Authentication Method Detection
New convenience methods on theAuthService make it easy to detect the current authentication method:
New Error Types
Two new error types provide better error handling:API Key Format Change
API keys now use a three-part format for better security: Old Format (still supported):- Clearer structure - Three distinct parts separated by dots
- Embedded signature - Cryptographic signature for verification
- Better security - Easier to validate and verify keys
Old API keys continue to work. The new format is used when creating new API keys in v0.3.0+.
Migration Guide
If you’re upgrading from an earlier version, here’s what you need to know:No Breaking Changes
All existing code continues to work. The new features are additive and don’t change existing behavior.Optional: Use New Detection Methods
You can optionally use the new authentication method detection in your code:Handle New Error Types
Add handlers for the new error types where appropriate:Check Token Type When Needed
If you need to know the token type:API Key Creation
When creating new API keys with the SDK v0.3.0+, they will use the new format:Examples
Conditional Logic Based on Auth Type
Email Verification Flow
API Key Permission Check
Summary of Changes
Next Steps
- Error Handling - Learn about all error types
- Authentication Overview - Complete authentication guide