Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GoTrueAdminApi

Hierarchy

  • GoTrueAdminApi

Index

Constructors

  • new GoTrueAdminApi(__namedParameters: { fetch?: ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>); headers?: {}; url: string }): GoTrueAdminApi
  • Parameters

    • __namedParameters: { fetch?: ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>); headers?: {}; url: string }
      • Optional fetch?: ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>)
          • (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
          • Parameters

            • input: RequestInfo | URL
            • Optional init: RequestInit

            Returns Promise<Response>

      • Optional headers?: {}
        • [key: string]: string
      • url: string

    Returns GoTrueAdminApi

Properties

Contains all MFA administration methods.

Methods

  • deleteUser(id: string, shouldSoftDelete?: boolean): Promise<UserResponse>
  • Delete a user. Requires a service_role key.

    Parameters

    • id: string

      The user id you want to remove.

    • shouldSoftDelete: boolean = false

      If true, then the user will be soft-deleted from the auth schema. Soft deletion allows user identification from the hashed user ID but is not reversible. Defaults to false for backward compatibility.

      This function should only be called on a server. Never expose your service_role key in the browser.

    Returns Promise<UserResponse>

  • Get user by id.

    Parameters

    • uid: string

      The user's unique identifier

      This function should only be called on a server. Never expose your service_role key in the browser.

    Returns Promise<UserResponse>

  • inviteUserByEmail(email: string, options?: { data?: object; redirectTo?: string }): Promise<UserResponse>
  • Sends an invite link to an email address.

    Parameters

    • email: string

      The email address of the user.

    • options: { data?: object; redirectTo?: string } = {}

      Additional options to be included when inviting.

      • Optional data?: object

        A custom data object to store additional metadata about the user. This maps to the auth.users.user_metadata column.

      • Optional redirectTo?: string

        The URL which will be appended to the email link sent to the user's email address. Once clicked the user will end up on this URL.

    Returns Promise<UserResponse>

  • Get a list of users.

    This function should only be called on a server. Never expose your service_role key in the browser.

    Parameters

    • Optional params: PageParams

      An object which supports page and perPage as numbers, to alter the paginated results.

    Returns Promise<{ data: { aud: string; users: User[] } & Pagination; error: null } | { data: { users: [] }; error: AuthError }>

  • signOut(jwt: string, scope?: "global" | "local" | "others"): Promise<{ data: null; error: null | AuthError }>
  • Removes a logged-in session.

    Parameters

    • jwt: string

      A valid, logged-in JWT.

    • scope: "global" | "local" | "others" = 'global'

      The logout sope.

    Returns Promise<{ data: null; error: null | AuthError }>

Generated using TypeDoc