Options
All
  • Public
  • Public/Protected
  • All
Menu

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

_deleteFactor: any
_listFactors: any
fetch: ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>)

Type declaration

    • (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
    • Parameters

      • input: RequestInfo | URL
      • Optional init: RequestInit

      Returns Promise<Response>

headers: {}

Type declaration

  • [key: string]: string

Contains all MFA administration methods.

url: string

Methods

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

    Parameters

    Returns Promise<UserResponse>

  • 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.

    • Optional shouldSoftDelete: boolean

      If true, then the user will be soft-deleted (setting deleted_at to the current timestamp and disabling their account while preserving their data) from the auth schema. 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>

  • Generates email links and OTPs to be sent via a custom email provider.

    Parameters

    Returns Promise<GenerateLinkResponse>

  • 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.

    • Optional 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: AuthUser[] } & 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.

    • Optional scope: "global" | "local" | "others"

      The logout sope.

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

  • Updates the user data.

    Parameters

    • uid: string
    • attributes: AdminUserAttributes

      The data you want to update.

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

    Returns Promise<UserResponse>

Generated using TypeDoc