Supabase.GoTrue (supabase_gotrue v0.3.0)

This module provides the functionality to interact with the GoTrue API, allowing management of users, sessions, and authentication.

It also aims to provide integrations with Plug and Phoenix LiveView applications.

For detailed information about the GoTrue API, check the official documentation at https://supabase.io/docs/reference/javascript/auth-api

And also refer to functions and submodules documentation for more information.

Summary

Functions

Get the user associated with the current session.

Signs in a user with ID token.

Signs in a user with OAuth.

Signs in a user with OTP.

Signs in a user with email/phone and password.

Signs in a user with SSO.

Signs up a user with email/phone and password.

Verifies an OTP code.

Types

Link to this opaque

client()

(opaque)
@opaque client()

Functions

Link to this function

get_user(client, session)

Get the user associated with the current session.

Parameters

Examples

iex> session = %Supabase.GoTrue.Session{access_token: "example_token"}
iex> Supabase.GoTrue.get_user(pid | client_name, session)
{:ok, %Supabase.GoTrue.User{}}
Link to this function

sign_in_with_id_token(client, credentials)

Signs in a user with ID token.

Parameters

Examples

iex> credentials = %Supabase.GoTrue.SignInWithIdToken{}
iex> Supabase.GoTrue.sign_in_with_id_token(pid | client_name, credentials)
{:ok, %Supabase.GoTrue.User{}}
Link to this function

sign_in_with_oauth(client, credentials)

Signs in a user with OAuth.

Parameters

Examples

iex> credentials = %Supabase.GoTrue.SignInWithOauth{}
iex> Supabase.GoTrue.sign_in_with_oauth(pid | client_name, credentials)
{:ok, atom, URI.t()}
Link to this function

sign_in_with_otp(client, credentials)

Signs in a user with OTP.

Parameters

Examples

iex> credentials = %Supabase.GoTrue.SignInWithOTP{}
iex> Supabase.GoTrue.sign_in_with_otp(pid | client_name, credentials)
{:ok, %Supabase.GoTrue.Session{}}
Link to this function

sign_in_with_password(client, credentials)

Signs in a user with email/phone and password.

Parameters

Examples

iex> credentials = %Supabase.GoTrue.SignInWithPassword{}
iex> Supabase.GoTrue.sign_in_with_password(pid | client_name, credentials)
{:ok, %Supabase.GoTrue.Session{}}
Link to this function

sign_in_with_sso(client, credentials)

Signs in a user with SSO.

Parameters

Examples

iex> credentials = %Supabase.GoTrue.SignInWithSSO{}
iex> Supabase.GoTrue.sign_in_with_sso(pid | client_name, credentials)
{:ok, %Supabase.GoTrue.User{}}
Link to this function

sign_up(client, credentials)

Signs up a user with email/phone and password.

Parameters

  • client - The Supabase client to use for the request.
  • credentials - The credentials to use for the sign up. Check Supabase.GoTrue.Schemas.SignUpWithPassword for more information.

Examples

iex> credentials = %Supabase.GoTrue.SignUpWithPassword{}
iex> Supabase.GoTrue.sign_up(pid | client_name, credentials)
{:ok, %Supabase.GoTrue.User{}}
Link to this function

verify_otp(client, params)

Verifies an OTP code.

Parameters

Examples

iex> params = %Supabase.GoTrue.VerifyOTP{}
iex> Supabase.GoTrue.verify_otp(pid | client_name, params)
{:ok, %Supabase.GoTrue.Session{}}