AuthNamespace class

Constructors

AuthNamespace(AmbaBindings _bindings)

Properties

authStateChanges Stream<Session?>
Raw broadcast stream of session changes. Prefer onAuthStateChange for the common callback-with-unsubscribe pattern; this getter exists for callers building higher-level reactive integrations (e.g. piping into a Riverpod/Bloc StreamProvider).
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getAnonymousId() Future<String>
Stable per-install anonymous identifier. Async for parity with the TS / native SDKs where the platform may need to await a persistence read; today the Dart core keeps it in memory and returns immediately.
getSession() Future<Session?>
Snapshot the current session, or null if no session is live.
linkAccount(String provider, String credential) Future<Map<String, dynamic>>
Link an additional provider credential to the current (anonymous or identified) account. NEW in 4.0.
me() Future<Map<String, dynamic>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAuthStateChange(void onChange(Session? session)) StreamSubscription<Session?>
Subscribe to session changes. Fires after every signIn*, signUp*, refresh, and signOut call. Returns a StreamSubscription — call .cancel() on it to unsubscribe.
refresh() Future<Map<String, dynamic>>
requestEmailOtp(String email) Future<void>
Request a one-time passcode for email. The server emails a 6-digit code; the user types it into the app, then call verifyEmailOtp to exchange for a session.
Request a passwordless sign-in link by email. NEW in 4.0.
requestSmsOtp(String phone) Future<void>
Request a one-time passcode by SMS. phone must be E.164 (starts with +, 8–15 total digits). The SDK rejects non- E.164 phones before the network call.
signInAnonymously() Future<Map<String, dynamic>>
signInWithApple(String identityToken) Future<Map<String, dynamic>>
signInWithEmail(String email, String password) Future<Map<String, dynamic>>
signInWithGoogle(String idToken) Future<Map<String, dynamic>>
signOut({bool rotateAnonymousId = false}) Future<void>
signUpWithEmail(String email, String password) Future<Map<String, dynamic>>
toString() String
A string representation of this object.
inherited
verifyEmailOtp(String email, String code) Future<Map<String, dynamic>>
Exchange email + code for a session. Returns the same AuthResult map shape as signInWithEmail.
Verify a magic-link token and return a session. NEW in 4.0.
verifySmsOtp(String phone, String code) Future<Map<String, dynamic>>
Exchange phone + code for a session. Same shape as verifyEmailOtp.

Operators

operator ==(Object other) bool
The equality operator.
inherited