Skip to main content
Provides methods for managing the current user’s account:
  • Connected accounts (link/unlink external identity providers)
  • MFA factors
  • Authentication methods (passkeys, phone, email, TOTP) - list, get, update, delete
  • Authentication method enrollment (challenge and verify)

Constructor

Parameters

Fetcher<Response>
required
Type: Fetcher
string
required

Returns

MyAccountApiClient

Methods

completeAccount()

Verify the redirect from the connect account flow and complete the connecting of the account.

Parameters

CompleteRequest
required
Completion parameters including auth session, connect code, and redirect URIType: CompleteRequest

Returns

Promise<CompleteResponse> A promise that resolves to the completed connected account details

connectAccount()

Get a ticket for the connect account flow.

Parameters

ConnectRequest
required
Connection parameters including connection name and redirect URIType: ConnectRequest

Returns

Promise<ConnectResponse> A promise that resolves to a connect response with the redirect URI and auth session

deleteAuthenticationMethod()

Delete an authentication method by ID.

Parameters

string
required
The ID of the authentication method to delete

Returns

Promise<void> A promise that resolves when the authentication method has been deleted

enrollmentChallenge()

Start the enrollment of an authentication method for the current user. The response shape varies by type.

Parameters

EnrollmentChallengeOptions
required
Enrollment challenge options specifying the factor type and any type-specific fieldsType: EnrollmentChallengeOptions

Returns

Promise<EnrollmentChallengeResponse> A promise that resolves to the enrollment challenge response (shape varies by type)

enrollmentVerify()

Confirm the enrollment of an authentication method to complete registration.

Parameters

EnrollmentVerifyOptions
required
Enrollment verify options including the auth session and type-specific verification dataType: EnrollmentVerifyOptions

Returns

Promise<AuthenticationMethod> A promise that resolves to the confirmed authentication method

getAuthenticationMethod()

Get an authentication method by ID.

Parameters

string
required
The ID of the authentication method to retrieve

Returns

Promise<AuthenticationMethod> A promise that resolves to the authentication method

getAuthenticationMethods()

Get a list of all authentication methods for the current user.

Parameters

AuthenticationMethodType
Optional filter to return only methods of a specific typeType: AuthenticationMethodType

Returns

Promise<AuthenticationMethod[]> A promise that resolves to an array of authentication methods

getFactors()

Get the status of all factors for the current user.

Returns

Promise<Factor[]> A promise that resolves to an array of factors with their enabled/disabled status

updateAuthenticationMethod()

Update details of an authentication method by ID.

Parameters

string
required
The ID of the authentication method to update
UpdateAuthenticationMethodRequest
required
The fields to update (e.g. name, preferred_authentication_method for phone)Type: UpdateAuthenticationMethodRequest

Returns

Promise<AuthenticationMethod> A promise that resolves to the updated authentication method