GoTrueClient class

Constructors

GoTrueClient({String? url, Map<String, String>? headers, bool? autoRefreshToken, CookieOptions? cookieOptions, Client? httpClient})

Properties

api GoTrueApi
Namespace for the GoTrue API methods. These can be used for example to get a user from a JWT in a server environment or reset a user's password.
getter/setter pair
autoRefreshToken bool
getter/setter pair
currentSession Session?
The session object for the currently logged in user or null.
getter/setter pair
currentUser User?
The currently logged in user or null.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stateChangeEmitters Map<String, Subscription>
getter/setter pair

Methods

getSessionFromUrl(Uri originUrl, {bool storeSession = true}) Future<GotrueSessionResponse>
Gets the session data from a oauth2 callback URL
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAuthStateChange(Callback callback) GotrueSubscription
recoverSession(String jsonStr) Future<GotrueSessionResponse>
Recover session from persisted session json string. Persisted session json has the format { currentSession, expiresAt }
refreshSession() Future<GotrueSessionResponse>
Force refreshes the session including the user data in case it was updated in a different session.
session() Session?
Returns the session data, if there is an active session.
setAuth(String accessToken) Session
Overrides the JWT on the current client. The JWT will then be sent in all subsequent network requests.
setSession(String refreshToken) Future<GotrueSessionResponse>
Sets the session data from refresh_token and returns current Session and Error
signIn({String? email, String? phone, String? password, Provider? provider, OpenIDConnectCredentials? oidc, AuthOptions? options}) Future<GotrueSessionResponse>
Log in an existing user, or login via a third-party provider.
signOut() Future<GotrueResponse>
Signs out the current user, if there is a logged in user.
signUp(String email, String password, {AuthOptions? options, Map<String, dynamic>? userMetadata}) Future<GotrueSessionResponse>
Creates a new user.
signUpWithPhone(String phone, String password, {AuthOptions? options, Map<String, dynamic>? userMetadata}) Future<GotrueSessionResponse>
Signs up a new user using their phone number and a password.
toString() String
A string representation of this object.
inherited
update(UserAttributes attributes) Future<GotrueUserResponse>
Updates user data, if there is a logged in user.
user() User?
Returns the user data, if there is a logged in user.
verifyOTP(String phone, String token, {AuthOptions? options}) Future<GotrueSessionResponse>
Log in a user given a User supplied OTP received via mobile.

Operators

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