vestibule_auth 2.0.2
vestibule_auth: ^2.0.2 copied to clipboard
Multi-tenant OTP authentication client for Vestibule
Changelog #
2.0.2 - 2026-08-09 #
Proactive token refresh for long-lived mobile sessions (app left open for days).
Changed #
- Default
refreshBufferis now 24 hours (was 5 minutes). getValidJWT({bool forceRefresh = false})— passforceRefresh: truebefore long-lived connections (e.g. voice WebSocket).- On app resume (foreground), always runs
getValidJWTso multi-day suspends renew access tokens instead of waiting for a 7-day timer that may never fire. - Hydrates in-memory tokens from secure storage when returning a stored JWT.
2.0.1 - 2026-05-19 #
Drop the vestigial Flutter plugin scaffold. v1 was created with
flutter create --template=plugin but the plugin classes were never
used (no MethodChannel calls anywhere in Dart). Becoming a pure
Flutter package eliminates the "plugin X does not support Swift
Package Manager" warning consumers were seeing on Flutter 3.35+.
Removed #
ios/,android/plugin scaffolds.flutter.pluginblock in pubspec.yaml.
No API changes.
2.0.0 - 2026-05-19 #
Breaking — full rewrite as a REST client. Connect RPC and protobuf-generated code removed.
Migration from 1.x #
- Constructor:
VestibuleClient({ required serverUrl, required tenantId, http.Client? httpClient, ... }). Thetransport: Transportparameter is gone. - Method names: prefer
requestOtp/verifyOtp/signInWithGoogle/signInWithApple/refreshToken(token)over their*_OTPvariants. The old names remain as@Deprecatedaliases. - Response fields: previously empty strings on absent values, now nullable.
if (result.jwt != null && result.jwt!.isNotEmpty)rather thanif (result.hasJwt()). - Errors: server failures now throw
VestibuleException(statusCode, code, message)instead ofConnectException. Codes:INVALID_ARGUMENT,NOT_FOUND,UNAUTHENTICATED,PERMISSION_DENIED,FAILED_PRECONDITION,INTERNAL. getProfile()/updateSmsOptIn(bool)/deleteUser()no longer take ajwtparameter. CallsetAuthTokens(...)first (or rely onautoSaveTokens: true).getPublicKey()is nowgetJwks()and returns a raw JWKS map{ "keys": [...] }.- DeliveryMethod enum:
DeliveryMethod.email/.sms(wasDELIVERY_METHOD_EMAIL/DELIVERY_METHOD_SMS— wire format unchanged). tenantIdfield removed from request bodies: it's derived from the URL path now.database_url/database_tokenremoved: per-user database routing is not part of the v2 surface.- Import path:
import 'package:vestibule_auth/client.dart'→import 'package:vestibule_auth/vestibule_auth.dart'(matches pub.dev convention of naming the main library after the package).
Removed #
protobuf,protoc_plugin,connectrpcdependencies.lib/gen/generated code.
Added #
http,metadependencies.- Hand-written request/response model classes in
lib/src/models/. VestibuleExceptionwith structured error codes.
0.0.1-beta.3 #
- Update flutter_fgbg to ^0.7.1 for compatibility
0.0.1-beta.2 #
- Add automatic JWT token refresh
- getValidJWT() method that auto-refreshes if token is expired/expiring
- Background refresh timer that refreshes tokens before expiry
- Configurable refreshBuffer (default 5 minutes before expiry)
- Add foreground-only refresh with flutter_fgbg
- Token refresh only runs when app is in foreground
- Automatically refreshes when returning from background if needed
- Add JWT expiry utilities
- isJwtExpired(), getJwtExpiry(), willExpireSoon()
- Add callbacks for token events
- onTokenRefresh callback when tokens are refreshed
- onTokenRefreshError callback when refresh fails
0.0.1-beta.1 #
- Initial beta release
- Email OTP authentication
- SMS OTP authentication
- Multi-factor authentication support
- Google Sign-In integration
- Apple Sign-In integration
- Secure token storage with flutter_secure_storage
- Optional automatic token management (autoSaveTokens parameter)
- Token refresh functionality
- FlutterFlow integration helpers with UID extraction
- Device fingerprinting
- Multi-tenant support