Supabase.GoTrue.Admin (supabase_gotrue v0.3.10)

Admin module for GoTrue. This module provides functions to interact with the GoTrue admin API, like signing out a user, inviting a user, and generating a link.

You can find more information about the GoTrue admin API at https://supabase.io/docs/reference/javascript/auth-admin-api

Summary

Functions

Creates a user in the GoTrue admin API.

Generates a link for the GoTrue admin API.

Gets a user by ID in the GoTrue admin API.

Invites a user to the GoTrue admin API.

Lists users in the GoTrue admin API.

Signs out a user from the GoTrue admin API.

Updates a user in the GoTrue admin API.

Functions

Link to this function

create_user(client, attrs)

Creates a user in the GoTrue admin API.

Parameters

Examples

iex> Supabase.GoTrue.Admin.create_user(pid | client_name, %{})
Link to this function

delete_user(client, user_id, opts \\ [should_soft_delete: false])

Deletes a user in the GoTrue admin API.

Parameters

  • client - The Supabase client to use for the request.
  • user_id - The ID of the user to delete.
  • opts - Controls if the user should be soft deleted or not.

Examples

iex> Supabase.GoTrue.Admin.update_user(pid | client_name, "user_id", %{})
Link to this function

generate_link(client, attrs)

Generates a link for the GoTrue admin API.

Parameters

Examples

iex> Supabase.GoTrue.Admin.generate_link(pid | client_name, %{})
Link to this function

get_user_by_id(client, user_id)

Gets a user by ID in the GoTrue admin API.

Parameters

  • client - The Supabase client to use for the request.
  • user_id - The ID of the user to get.

Examples

iex> Supabase.GoTrue.Admin.get_user_by_id(pid | client_name, "user_id")
Link to this function

invite_user_by_email(client, email, options \\ %{})

Invites a user to the GoTrue admin API.

Parameters

Examples

iex> Supabase.GoTrue.Admin.invite_user_by_email(pid | client_name, "john@example.com", %{})
Link to this function

list_users(client, params \\ %{})

Lists users in the GoTrue admin API.

Parameters

Examples

iex> Supabase.GoTrue.Admin.list_users(pid | client_name, %{})
Link to this function

sign_out(client, session, scope)

Signs out a user from the GoTrue admin API.

Parameters

  • client - The Supabase client to use for the request.
  • session - The session to sign out, often retrieved from a sign in function.
  • scope - The scope to sign out the user from. Can be one of global, local, or others.

Examples

iex> session = %Session{access_token: "access_token"}
iex> Supabase.GoTrue.Admin.sign_out(pid | client_name, session, "global")
Link to this function

update_user_by_id(client, user_id, attrs)

Updates a user in the GoTrue admin API.

Parameters

Examples

iex> Supabase.GoTrue.Admin.update_user(pid | client_name, "user_id", %{})