Skip to content
Alchemy Logo

AlchemySignerWebClient

Defined in: account-kit/signer/src/client/index.ts:60

A lower level client used by the AlchemySigner used to communicate with Alchemy's signer service.

new AlchemySignerWebClient(params): AlchemySignerWebClient;

Defined in: account-kit/signer/src/client/index.ts:95

Initializes a new instance with the given parameters, setting up the connection, iframe configuration, and WebAuthn stamper.

Example

import { AlchemySignerWebClient } from "@account-kit/signer";
 
const client = new AlchemySignerWebClient({
  connection: {
    apiKey: "your-api-key",
  },
  iframeConfig: {
    iframeContainerId: "signer-iframe-container",
  },
});

Parameters

ParameterTypeDescription

params

Object

the parameters required to initialize the client

Returns

AlchemySignerWebClient

Overrides

BaseSignerClient.constructor

PropertyType

eventEmitter

EventEmitter<AlchemySignerClientEvents>

iframeConfig

object

iframeConfig.iframeContainerId

string

iframeConfig.iframeElementId

string

oauthCallbackUrl

string

oauthConfig

undefined | OauthConfig

rootOrg

string

turnkeyClient

TurnkeyClient

Get Signature

get protected user(): undefined | User;

Defined in: account-kit/signer/src/client/base.ts:147

Returns

undefined | User

Set Signature

set protected user(user): void;

Defined in: account-kit/signer/src/client/base.ts:151

Parameters
ParameterType

user

undefined | User

Returns

void

Inherited from

BaseSignerClient.user

addMfa(params): Promise<AddMfaResult>;

Defined in: account-kit/signer/src/client/base.ts:1174

Initiates the setup of a new MFA factor for the current user. Mfa will need to be verified before it is active.

Parameters

ParameterTypeDescription

params

AddMfaParams

The parameters required to enable a new MFA factor

Returns

Promise<AddMfaResult>

A promise that resolves to the factor setup information

Throws

If no user is authenticated

Throws

If an unsupported factor type is provided

Inherited from

BaseSignerClient.addMfa


addOauthProvider(params): Promise<OauthProviderInfo>;

Defined in: account-kit/signer/src/client/base.ts:616

Adds an OAuth provider for the authenticated user using the provided parameters. Throws an error if the user is not authenticated.

Parameters

ParameterTypeDescription

params

AddOauthProviderParams

The parameters for adding an OAuth provider, including providerName and oidcToken.

Returns

Promise<OauthProviderInfo>

A Promise that resolves when the OAuth provider is added.

Throws

Throws if the user is not authenticated.

Inherited from

BaseSignerClient.addOauthProvider


addPasskey(options): Promise<string[]>;

Defined in: account-kit/signer/src/client/base.ts:509

Handles the creation of authenticators using WebAuthn attestation and the provided options. Requires the user to be authenticated.

Parameters

ParameterTypeDescription

options

CredentialCreationOptions

The options used to create the WebAuthn attestation

Returns

Promise<string[]>

A promise that resolves to an array of authenticator IDs

Throws

If the user is not authenticated

Inherited from

BaseSignerClient.addPasskey


completeAuthWithBundle(config): Promise<User>;

Defined in: account-kit/signer/src/client/index.ts:337

Completes auth for the user by injecting a credential bundle and retrieving the user information based on the provided organization ID. Emits events during the process.

Example

import { AlchemySignerWebClient } from "@account-kit/signer";
 
const client = new AlchemySignerWebClient({
  connection: {
    apiKey: "your-api-key",
  },
  iframeConfig: {
    iframeContainerId: "signer-iframe-container",
  },
});
 
const account = await client.completeAuthWithBundle({
  orgId: "user-org-id",
  bundle: "bundle-from-email",
  connectedEventName: "connectedEmail",
});

Parameters

ParameterTypeDescription

config

{ accessToken?: string; authenticatingType: "email" | "otp" | "sms" | "passkey" | "oauth" | "otpVerify" | "custom-jwt"; bundle: string; connectedEventName: keyof AlchemySignerClientEvents; idToken?: string; orgId: string; }

The configuration object for the authentication function containing the credential bundle to inject and the organization id associated with the user, as well as the event to be emitted on success and optionally an OIDC ID token with extra user information

config.accessToken?

string

config.authenticatingType

"email" | "otp" | "sms" | "passkey" | "oauth" | "otpVerify" | "custom-jwt"

config.bundle

string

config.connectedEventName

keyof AlchemySignerClientEvents

config.idToken?

string

config.orgId

string

Returns

Promise<User>

A promise that resolves to the authenticated user information

Overrides

BaseSignerClient.completeAuthWithBundle


createAccount(params): Promise<SignupResponse>;

Defined in: account-kit/signer/src/client/base.ts:176

Authenticates the user by either email or passkey account creation flow. Emits events during the process.

Parameters

ParameterTypeDescription

params

CreateAccountParams

The parameters for creating an account, including the type (email or passkey) and additional details.

Returns

Promise<SignupResponse>

A promise that resolves with the response object containing the account creation result.

Inherited from

BaseSignerClient.createAccount


disconnect(): Promise<void>;

Defined in: account-kit/signer/src/client/index.ts:461

Asynchronous function that clears the user and resets the iframe stamper.

Example

import { AlchemySignerWebClient } from "@account-kit/signer";
 
const client = new AlchemySignerWebClient({
  connection: {
    apiKey: "your-api-key",
  },
  iframeConfig: {
    iframeContainerId: "signer-iframe-container",
  },
});
 
const account = await client.disconnect();

Returns

Promise<void>

Overrides

BaseSignerClient.disconnect


experimental_addToMultiOwner(orgId, members): Promise<void>;

Defined in: account-kit/signer/src/client/base.ts:1019

This will add additional members to an existing multi-sig account

Parameters

ParameterTypeDescription

orgId

string

orgId of the multi-sig to add members to

members

`0x${string}`[]

the addresses of the members to add

Returns

Promise<void>

Inherited from

BaseSignerClient.experimental_addToMultiOwner


experimental_createApiKey(params): Promise<void>;

Defined in: account-kit/signer/src/client/base.ts:782

Creates an API key that can take any action on behalf of the current user. (Note that this method is currently experimental and is subject to change.)

Parameters

ParameterTypeDescription

params

experimental_CreateApiKeyParams

Parameters for creating the API key.

Returns

Promise<void>

Throws

If there is no authenticated user or the API key creation fails.

Inherited from

BaseSignerClient.experimental_createApiKey


experimental_createMultiOwner(additionalMembers): Promise<{
  evmSignerAddress: `0x${string}`;
  members: object[];
  orgId: string;
}>;

Defined in: account-kit/signer/src/client/base.ts:997

This will create a multi-owner account with the current user and additional specified signers

Parameters

ParameterTypeDescription

additionalMembers

`0x${string}`[]

members to add, aside from the currently authenticated user

Returns

Promise<{ evmSignerAddress: `0x${string}`; members: object[]; orgId: string; }>

created multi-owner account

Inherited from

BaseSignerClient.experimental_createMultiOwner


experimental_deleteFromMultiOwner(orgId, members): Promise<void>;

Defined in: account-kit/signer/src/client/base.ts:1057

This will remove members from an existing multi-sig account

Parameters

ParameterTypeDescription

orgId

string

orgId of the multi-sig to remove members from

members

`0x${string}`[]

the addresses of the members to remove

Returns

Promise<void>

Inherited from

BaseSignerClient.experimental_deleteFromMultiOwner


experimental_multiOwnerExportPrivateKeyEncrypted(opts): Promise<ExportPrivateKeyEncryptedResult>;

Defined in: account-kit/signer/src/client/base.ts:1571

Exports a private key for a given account in a multi-owner org

Parameters

ParameterTypeDescription

opts

MultiOwnerExportPrivateKeyParams & object

the parameters for the export

Returns

Promise<ExportPrivateKeyEncryptedResult>

the private key

Inherited from

BaseSignerClient.experimental_multiOwnerExportPrivateKeyEncrypted


experimental_multiOwnerSignRawMessage(
   msg,
   orgId,
   orgAddress): Promise<`0x${string}`>;

Defined in: account-kit/signer/src/client/base.ts:960

This will sign on behalf of the multi-owner org, without doing any transformations on the message. For SignMessage or SignTypedData, the caller should hash the message before calling this method and pass that result here.

Parameters

ParameterTypeDescription

msg

`0x${string}`

the hex representation of the bytes to sign

orgId

string

orgId of the multi-owner org to sign on behalf of

orgAddress

string

address of the multi-owner org to sign on behalf of

Returns

Promise<`0x${string}`>

the signature over the raw hex

Inherited from

BaseSignerClient.experimental_multiOwnerSignRawMessage


exportPrivateKeyEncrypted(opts): Promise<ExportPrivateKeyEncryptedResult>;

Defined in: account-kit/signer/src/client/base.ts:1519

Exports a private key for a given account encrypted with the provided public key

Parameters

ParameterTypeDescription

opts

ExportPrivateKeyParams & object

the parameters for the export

Returns

Promise<ExportPrivateKeyEncryptedResult>

the private key

Inherited from

BaseSignerClient.exportPrivateKeyEncrypted


exportWallet(config): Promise<boolean>;

Defined in: account-kit/signer/src/client/index.ts:395

Initiates the export of a wallet by creating an iframe stamper and calling the appropriate export function. The export can be based on a seed phrase or a private key.

Example

import { AlchemySignerWebClient } from "@account-kit/signer";
 
const client = new AlchemySignerWebClient({
  connection: {
    apiKey: "your-api-key",
  },
  iframeConfig: {
    iframeContainerId: "signer-iframe-container",
  },
});
 
const account = await client.exportWallet({
  iframeContainerId: "export-iframe-container",
});

Parameters

ParameterTypeDescription

config

ExportWalletParams

The parameters for exporting the wallet

Returns

Promise<boolean>

A promise that resolves when the export process is complete

Overrides

BaseSignerClient.exportWallet


protected exportWalletInner(params): Promise<boolean>;

Defined in: account-kit/signer/src/client/index.ts:427

Exports wallet credentials based on the specified type, either as a SEED_PHRASE or PRIVATE_KEY.

Parameters

ParameterTypeDescription

params

{ exportAs: "SEED_PHRASE" | "PRIVATE_KEY"; exportStamper: ExportWalletStamper; }

The parameters for exporting the wallet

params.exportAs

"SEED_PHRASE" | "PRIVATE_KEY"

Specifies the format for exporting the wallet, either as a SEED_PHRASE or PRIVATE_KEY

params.exportStamper

ExportWalletStamper

The stamper used for exporting the wallet

Returns

Promise<boolean>

A promise that resolves to true if the export is successful


getMfaFactors(): Promise<{
  multiFactors: MfaFactor[];
}>;

Defined in: account-kit/signer/src/client/base.ts:1142

Retrieves the list of MFA factors configured for the current user.

Returns

Promise<{ multiFactors: MfaFactor[]; }>

A promise that resolves to an array of configured MFA factors

Throws

If no user is authenticated

Inherited from

BaseSignerClient.getMfaFactors


protected getOauthConfig(): Promise<OauthConfig>;

Defined in: account-kit/signer/src/client/index.ts:730

Returns

Promise<OauthConfig>

Overrides

BaseSignerClient.getOauthConfig


protected getOauthNonce(turnkeyPublicKey): string;

Defined in: account-kit/signer/src/client/base.ts:1509

Turnkey requires the nonce in the id token to be in this format.

Parameters

ParameterTypeDescription

turnkeyPublicKey

string

key from a Turnkey iframe

Returns

string

nonce to be used in OIDC

Inherited from

BaseSignerClient.getOauthNonce


protected getOauthProviderUrl(args): Promise<string>;

Defined in: account-kit/signer/src/client/base.ts:1334

Returns the authentication url for the selected OAuth Proivder

Example

 
cosnt oauthParams = {
 authProviderId: "google",
 isCustomProvider: false,
 auth0Connection: undefined,
 scope: undefined,
 claims: undefined,
 mode: "redirect",
 redirectUrl: "https://your-url-path/oauth-return",
 expirationSeconds: 3000
};
 
const turnkeyPublicKey = await this.initIframeStamper();
const oauthCallbackUrl = this.oauthCallbackUrl;
const oauthConfig = this.getOauthConfig() // Optional value for OauthConfig()
const usesRelativeUrl = true // Optional value to determine if we use a relative (or absolute) url for the `redirect_url`
 
const oauthProviderUrl = getOauthProviderUrl({
 oauthParams,
 turnkeyPublicKey,
 oauthCallbackUrl
})
 

Parameters

ParameterTypeDescription

args

GetOauthProviderUrlArgs

Required. The Oauth provider's auth parameters

Returns

Promise<string>

returns the Oauth provider's url

Inherited from

BaseSignerClient.getOauthProviderUrl


getPasskeyStatus(): Promise<{
  isPasskeyAdded: boolean;
}>;

Defined in: account-kit/signer/src/client/base.ts:594

Retrieves the status of the passkey for the current user. Requires the user to be authenticated.

Returns

Promise<{ isPasskeyAdded: boolean; }>

A promise that resolves to an object containing the passkey status

Throws

If the user is not authenticated

Inherited from

BaseSignerClient.getPasskeyStatus


getUser(): null | User;

Defined in: account-kit/signer/src/client/base.ts:1092

Returns the current user or null if no user is set.

Returns

null | User

the current user object or null if no user is available

Inherited from

BaseSignerClient.getUser


protected getWebAuthnAttestation(options?, userDetails?): Promise<GetWebAuthnAttestationResult>;

Defined in: account-kit/signer/src/client/index.ts:675

Parameters

ParameterType

options?

CredentialCreationOptionOverrides

userDetails?

{ username: string; }

userDetails.username?

string

Returns

Promise<GetWebAuthnAttestationResult>

Overrides

BaseSignerClient.getWebAuthnAttestation


initEmailAuth(params): Promise<{
  multiFactors?: MfaFactor[];
  orgId: string;
  otpId?: string;
}>;

Defined in: account-kit/signer/src/client/index.ts:144

Begin authenticating a user with their email and an expiration time for the authentication request. Initializes the iframe stamper to get the target public key. This method sends an email to the user to complete their login

Example

import { AlchemySignerWebClient } from "@account-kit/signer";
 
const client = new AlchemySignerWebClient({
  connection: {
    apiKey: "your-api-key",
  },
  iframeConfig: {
    iframeContainerId: "signer-iframe-container",
  },
});
 
const account = await client.initEmailAuth({ email: "you@mail.com" });

Parameters

ParameterTypeDescription

params

Omit<EmailAuthParams, "targetPublicKey">

The parameters for email authentication, excluding the target public key

Returns

Promise<{ multiFactors?: MfaFactor[]; orgId: string; otpId?: string; }>

The response from the authentication request

Overrides

BaseSignerClient.initEmailAuth


initOauth(): Promise<OauthConfig>;

Defined in: account-kit/signer/src/client/base.ts:142

Asynchronously fetches and sets the OAuth configuration.

Returns

Promise<OauthConfig>

A promise that resolves to the OAuth configuration

Inherited from

BaseSignerClient.initOauth


initOtp(type, contact): Promise<{
  otpId: string;
}>;

Defined in: account-kit/signer/src/client/base.ts:492

Initiates an OTP (One-Time Password) verification process for a user contact.

Parameters

ParameterTypeDescription

type

"email" | "sms"

The type of OTP to send, either "email" or "sms"

contact

string

The email address or phone number to send the OTP to

Returns

Promise<{ otpId: string; }>

A promise that resolves to an object containing the OTP ID

Throws

When no user is currently authenticated

Inherited from

BaseSignerClient.initOtp


protected initSessionStamper(): Promise<string>;

Defined in: account-kit/signer/src/client/index.ts:742

Initializes the session stamper and returns its public key.

Returns

Promise<string>

Overrides

BaseSignerClient.initSessionStamper


initSmsAuth(params): Promise<{
  multiFactors?: MfaFactor[];
  orgId: string;
  otpId?: string;
}>;

Defined in: account-kit/signer/src/client/index.ts:195

Begin authenticating a user through sms. Initializes the iframe stamper to get the target public key. This method sends a text message to the user to complete their login

Example

import { AlchemySignerWebClient } from "@account-kit/signer";
 
const client = new AlchemySignerWebClient({
  connection: {
    apiKey: "your-api-key",
  },
  iframeConfig: {
    iframeContainerId: "signer-iframe-container",
  },
});
 
const account = await client.initSmsAuth({ phone: "+1234567890" });

Parameters

ParameterTypeDescription

params

Omit<SmsAuthParams, "targetPublicKey">

The parameters for sms authentication, excluding the target public key

Returns

Promise<{ multiFactors?: MfaFactor[]; orgId: string; otpId?: string; }>

The response from the authentication request

Overrides

BaseSignerClient.initSmsAuth


protected initWebauthnStamper(user): Promise<void>;

Defined in: account-kit/signer/src/client/index.ts:765

Parameters

ParameterType

user

undefined | User

Returns

Promise<void>

Overrides

BaseSignerClient.initWebauthnStamper


listAuthMethods(): Promise<AuthMethods>;

Defined in: account-kit/signer/src/client/base.ts:666

Retrieves the list of authentication methods for the current user.

Returns

Promise<AuthMethods>

A promise that resolves to the list of authentication methods

Throws

If the user is not authenticated

Inherited from

BaseSignerClient.listAuthMethods


lookupUserByAccessKey(params): Promise<{
  orgId: null | string;
}>;

Defined in: account-kit/signer/src/client/base.ts:835

Looks up information based on an access key.

Parameters

ParameterTypeDescription

params

LookupUserByAccessKeyParams

The access key parameters

Returns

Promise<{ orgId: null | string; }>

The result of the lookup request

Inherited from

BaseSignerClient.lookupUserByAccessKey


lookupUserByEmail(email): Promise<{
  orgId: null | string;
}>;

Defined in: account-kit/signer/src/client/base.ts:815

Looks up information based on an email address.

Parameters

ParameterTypeDescription

email

string

the email address to look up

Returns

Promise<{ orgId: null | string; }>

the result of the lookup request

Inherited from

BaseSignerClient.lookupUserByEmail


lookupUserByPhone(phone): Promise<{
  orgId: null | string;
}>;

Defined in: account-kit/signer/src/client/base.ts:825

Looks up information based on a phone number.

Parameters

ParameterTypeDescription

phone

string

the phone number to look up

Returns

Promise<{ orgId: null | string; }>

the result of the lookup request

Inherited from

BaseSignerClient.lookupUserByPhone


lookupUserWithPasskey(user?): Promise<User>;

Defined in: account-kit/signer/src/client/base.ts:572

Asynchronously handles the authentication process using WebAuthn Stamper. If a user is provided, sets the user and returns it. Otherwise, retrieves the current user and initializes the WebAuthn stamper.

Parameters

ParameterTypeDefault valueDescription

user?

User

undefined

An optional user object to authenticate

Returns

Promise<User>

A promise that resolves to the authenticated user object

Inherited from

BaseSignerClient.lookupUserWithPasskey


oauthWithPopup(args): Promise<
  | User
  | AuthLinkingPrompt
  | IdTokenOnly>;

Defined in: account-kit/signer/src/client/index.ts:550

Initiates an OAuth authentication flow in a popup window and returns the authenticated user.

Example

import { AlchemySignerWebClient } from "@account-kit/signer";
 
const client = new AlchemySignerWebClient({
  connection: {
    apiKey: "your-api-key",
  },
  iframeConfig: {
    iframeContainerId: "signer-iframe-container",
  },
});
 
const user = await client.oauthWithPopup({
  type: "oauth",
  authProviderId: "google",
  mode: "popup",
});

Parameters

ParameterTypeDescription

args

| object & object & object | object & object & object | object & object & object

The authentication parameters specifying OAuth type and popup mode

Returns

Promise< | User | AuthLinkingPrompt | IdTokenOnly>

A promise that resolves to a User object containing the authenticated user information

Overrides

BaseSignerClient.oauthWithPopup


oauthWithRedirect(args): Promise<
  | User
  | IdTokenOnly>;

Defined in: account-kit/signer/src/client/index.ts:506

Redirects the user to the OAuth provider URL based on the provided arguments. This function will always reject after 1 second if the redirection does not occur.

Example

import { AlchemySignerWebClient } from "@account-kit/signer";
 
const client = new AlchemySignerWebClient({
  connection: {
    apiKey: "your-api-key",
  },
  iframeConfig: {
    iframeContainerId: "signer-iframe-container",
  },
});
 
await client.oauthWithRedirect({
  type: "oauth",
  authProviderId: "google",
  mode: "redirect",
  redirectUrl: "/",
});

Parameters

ParameterTypeDescription

args

| object & object & object | object & object & object | object & object & object

The arguments required to obtain the OAuth provider URL

Returns

Promise< | User | IdTokenOnly>

A promise that will never resolve, only reject if the redirection fails

Overrides

BaseSignerClient.oauthWithRedirect


on<E>(event, listener): () => any;

Defined in: account-kit/signer/src/client/base.ts:314

Listen to events emitted by the client

Type Parameters

Type Parameter

E extends keyof AlchemySignerClientEvents

Parameters

ParameterTypeDescription

event

E

the event you want to listen to

listener

AlchemySignerClientEvents[E]

the callback function to execute when an event is fired

Returns

a function that will remove the listener when called

(): any;
Returns

any

Inherited from

BaseSignerClient.on


protected pollActivityCompletion<T>(
   activity,
   organizationId,
   resultKey): Promise<NonNullable<object[T]>>;

Defined in: account-kit/signer/src/client/base.ts:1454

Type Parameters

Type Parameter

T extends | "createOrganizationResult" | "createAuthenticatorsResult" | "createUsersResult" | "createPrivateKeysResult" | "createInvitationsResult" | "acceptInvitationResult" | "signRawPayloadResult" | "createPolicyResult" | "disablePrivateKeyResult" | "deleteUsersResult" | "deleteAuthenticatorsResult" | "deleteInvitationResult" | "deleteOrganizationResult" | "deletePolicyResult" | "createUserTagResult" | "deleteUserTagsResult" | "signTransactionResult" | "deleteApiKeysResult" | "createApiKeysResult" | "createPrivateKeyTagResult" | "deletePrivateKeyTagsResult" | "setPaymentMethodResult" | "activateBillingTierResult" | "deletePaymentMethodResult" | "createApiOnlyUsersResult" | "updateRootQuorumResult" | "updateUserTagResult" | "updatePrivateKeyTagResult" | "createSubOrganizationResult" | "updateAllowedOriginsResult" | "createPrivateKeysResultV2" | "updateUserResult" | "updatePolicyResult" | "createSubOrganizationResultV3" | "createWalletResult" | "createWalletAccountsResult" | "initUserEmailRecoveryResult" | "recoverUserResult" | "setOrganizationFeatureResult" | "removeOrganizationFeatureResult" | "exportPrivateKeyResult" | "exportWalletResult" | "createSubOrganizationResultV4" | "emailAuthResult" | "exportWalletAccountResult" | "initImportWalletResult" | "importWalletResult" | "initImportPrivateKeyResult" | "importPrivateKeyResult" | "createPoliciesResult" | "signRawPayloadsResult" | "createReadOnlySessionResult" | "createOauthProvidersResult" | "deleteOauthProvidersResult" | "createSubOrganizationResultV5" | "oauthResult" | "createReadWriteSessionResult" | "createSubOrganizationResultV6" | "deletePrivateKeysResult" | "deleteWalletsResult" | "createReadWriteSessionResultV2" | "deleteSubOrganizationResult" | "initOtpAuthResult" | "otpAuthResult" | "createSubOrganizationResultV7" | "updateWalletResult" | "updatePolicyResultV2" | "initOtpAuthResultV2" | "initOtpResult" | "verifyOtpResult" | "otpLoginResult" | "stampLoginResult" | "oauthLoginResult" | "updateUserNameResult" | "updateUserEmailResult" | "updateUserPhoneNumberResult" | "initFiatOnRampResult" | "createSmartContractInterfaceResult" | "deleteSmartContractInterfaceResult" | "enableAuthProxyResult" | "disableAuthProxyResult" | "updateAuthProxyConfigResult" | "createOauth2CredentialResult" | "updateOauth2CredentialResult" | "deleteOauth2CredentialResult" | "oauth2AuthenticateResult"

Parameters

ParameterType

activity

Object

organizationId

string

resultKey

T

Returns

Promise<NonNullable<object[T]>>

Inherited from

BaseSignerClient.pollActivityCompletion


removeEmail(): Promise<void>;

Defined in: account-kit/signer/src/client/base.ts:382

Removes the email for the authenticated user, disallowing them from login with that email.

Returns

Promise<void>

A promise that resolves when the email is removed

Throws

If the user is not authenticated

Inherited from

BaseSignerClient.removeEmail


removeMfa(params): Promise<{
  multiFactors: MfaFactor[];
}>;

Defined in: account-kit/signer/src/client/base.ts:1244

Removes existing MFA factors by ID.

Parameters

ParameterTypeDescription

params

RemoveMfaParams

The parameters specifying which factors to disable

Returns

Promise<{ multiFactors: MfaFactor[]; }>

A promise that resolves to the updated list of MFA factors

Throws

If no user is authenticated

Inherited from

BaseSignerClient.removeMfa


removeOauthProvider(providerId): Promise<void>;

Defined in: account-kit/signer/src/client/base.ts:644

Deletes a specified OAuth provider for the authenticated user.

Parameters

ParameterTypeDescription

providerId

string

The ID of the provider to be deleted

Returns

Promise<void>

Throws

If the user is not authenticated

Inherited from

BaseSignerClient.removeOauthProvider


removePasskey(authenticatorId): Promise<void>;

Defined in: account-kit/signer/src/client/base.ts:551

Removes a passkey authenticator from the user's account.

Parameters

ParameterTypeDescription

authenticatorId

string

The ID of the authenticator to remove.

Returns

Promise<void>

A promise that resolves when the authenticator is removed.

Throws

If the user is not authenticated.

Inherited from

BaseSignerClient.removePasskey


removePhoneNumber(): Promise<void>;

Defined in: account-kit/signer/src/client/base.ts:451

Removes the phone number for the authenticated user, disallowing them from login with that phone number.

Returns

Promise<void>

A promise that resolves when the phone number is removed

Throws

If the user is not authenticated

Inherited from

BaseSignerClient.removePhoneNumber


request<R>(route, body): Promise<SignerResponse<R>>;

Defined in: account-kit/signer/src/client/base.ts:1104

Sends a POST request to the given signer route with the specified body and returns the response. Not intended to be used directly, use the specific methods instead on the client instead.

Type Parameters

Type Parameter

R extends | "/v1/signup" | "/v1/whoami" | "/v1/auth" | "/v1/lookup" | "/v1/init-otp" | "/v1/verify-otp" | "/v1/sign-payload" | "/v1/update-email-auth" | "/v1/update-phone-auth" | "/v1/add-oauth-provider" | "/v1/remove-oauth-provider" | "/v1/list-auth-methods" | "/v1/prepare-oauth" | "/v1/otp" | "/v1/auth-list-multi-factors" | "/v1/auth-delete-multi-factors" | "/v1/auth-request-multi-factor" | "/v1/auth-verify-multi-factor" | "/v1/auth-jwt" | "/v1/signer-config" | "/v1/auth-validate-multi-factors" | "/v1/multi-owner-create" | "/v1/multi-owner-prepare-add" | "/v1/multi-owner-add" | "/v1/multi-owner-update-root-quorum" | "/v1/multi-owner-sign-raw-payload" | "/v1/multi-owner-prepare-delete" | "/v1/multi-owner-delete"

Parameters

ParameterTypeDescription

route

R

The route to which the request should be sent

body

SignerBody<R>

The request body containing the data to be sent

Returns

Promise<SignerResponse<R>>

A promise that resolves to the response from the signer

Inherited from

BaseSignerClient.request


Implementation for setEmail method with optional OTP verification.

Param

An OTP object containing the OTP ID & OTP code (or an email address for legacy usage)

Call Signature

setEmail(email): Promise<string>;

Defined in: account-kit/signer/src/client/base.ts:336

Sets the email for the authenticated user, allowing them to login with that email.

Deprecated

You must contact Alchemy to enable this feature for your team, as there are important security considerations. In particular, you must not call this without first validating that the user owns this email account. Recommended to use the email verification flow instead.

Parameters
ParameterTypeDescription

email

string

The email to set for the user

Returns

Promise<string>

A promise that resolves to the updated email

Throws

If the user is not authenticated

Inherited from

BaseSignerClient.setEmail

Call Signature

setEmail(otp): Promise<string>;

Defined in: account-kit/signer/src/client/base.ts:346

Sets the email for the authenticated user, allowing them to login with that email. Must be called after calling initOtp with the email.

Parameters
ParameterTypeDescription

otp

VerificationOtp

The OTP verification object including the OTP ID and OTP code

Returns

Promise<string>

A promise that resolves to the updated email

Throws

If the user is not authenticated

Inherited from

BaseSignerClient.setEmail


setPhoneNumber(otp): Promise<void>;

Defined in: account-kit/signer/src/client/base.ts:436

Updates the phone number for the authenticated user, allowing them to login with that phone number. Must be called after calling initOtp with the phone number.

Parameters

ParameterTypeDescription

otp

VerificationOtp

The OTP object including the OTP ID and OTP code

Returns

Promise<void>

A promise that resolves when the phone number is set

Throws

If the user is not authenticated

Inherited from

BaseSignerClient.setPhoneNumber


protected setStamper(stamper): void;

Defined in: account-kit/signer/src/client/base.ts:166

Sets the stamper of the TurnkeyClient.

Parameters

ParameterTypeDescription

stamper

TStamper

the stamper function to set for the TurnkeyClient

Returns

void

Inherited from

BaseSignerClient.setStamper


signRawMessage(msg, mode): Promise<`0x${string}`>;

Defined in: account-kit/signer/src/client/base.ts:852

This will sign a message with the user's private key, without doing any transformations on the message. For SignMessage or SignTypedData, the caller should hash the message before calling this method and pass that result here.

Parameters

ParameterTypeDefault valueDescription

msg

`0x${string}`

undefined

the hex representation of the bytes to sign

mode

"SOLANA" | "ETHEREUM"

"ETHEREUM"

specify if signing should happen for solana or ethereum

Returns

Promise<`0x${string}`>

the signature over the raw hex

Inherited from

BaseSignerClient.signRawMessage


stampGetOrganization(): Promise<TSignedRequest>;

Defined in: account-kit/signer/src/client/base.ts:760

Generates a stamped getOrganization request for the current user.

Returns

Promise<TSignedRequest>

a promise that resolves to the "getOrganization" information for the logged in user

Throws

if no user is authenticated

Inherited from

BaseSignerClient.stampGetOrganization


stampWhoami(): Promise<TSignedRequest>;

Defined in: account-kit/signer/src/client/base.ts:744

Generates a stamped whoami request for the current user. This request can then be used to call /signer/v1/whoami to get the user information. This is useful if you want to get the user information in a different context like a server. You can pass the stamped request to the server and then call our API to get the user information. Using this stamp is the most trusted way to get the user information since a stamp can only belong to the user who created it.

Returns

Promise<TSignedRequest>

a promise that resolves to the "whoami" information for the logged in user

Throws

if no organization ID is provided

Inherited from

BaseSignerClient.stampWhoami


submitJwt(args): Promise<JwtResponse>;

Defined in: account-kit/signer/src/client/index.ts:295

Authenticates using a custom issued JWT

Example

import { AlchemySignerWebClient } from "@account-kit/signer";
 
const client = new AlchemySignerWebClient({
  connection: {
    apiKey: "your-api-key",
  },
  iframeConfig: {
    iframeContainerId: "signer-iframe-container",
  },
});
 
const account = await client.submitJwt({
  jwt: "custom-issued-jwt",
  authProvider: "auth-provider-name",
});

Parameters

ParameterTypeDescription

args

Omit<JwtParams, "targetPublicKey">

The parameters for the JWT request, excluding the target public key.

Returns

Promise<JwtResponse>

A promise that resolves to an object containing the credential bundle.

Overrides

BaseSignerClient.submitJwt


submitOtpCode(args): Promise<SubmitOtpCodeResponse>;

Defined in: account-kit/signer/src/client/index.ts:234

Authenticates using an OTP code which was previously received via email.

Example

import { AlchemySignerWebClient } from "@account-kit/signer";
 
const client = new AlchemySignerWebClient({
  connection: {
    apiKey: "your-api-key",
  },
  iframeConfig: {
    iframeContainerId: "signer-iframe-container",
  },
});
 
const account = await client.submitOtpCode({
  orgId: "user-org-id",
  otpId: "opt-returned-from-initEmailAuth",
  otpCode: "otp-code-from-email",
});

Parameters

ParameterTypeDescription

args

Omit<OtpParams, "targetPublicKey">

The parameters for the OTP request, excluding the target public key.

Returns

Promise<SubmitOtpCodeResponse>

A promise that resolves to an object containing the credential bundle.

Overrides

BaseSignerClient.submitOtpCode


targetPublicKey(): Promise<string>;

Defined in: account-kit/signer/src/client/index.ts:671

Initializes the iframe stamper and returns its public key.

Example

import { AlchemySignerWebClient } from "@account-kit/signer";
 
const client = new AlchemySignerWebClient({
  connection: {
    apiKey: "your-api-key",
  },
  iframeConfig: {
    iframeContainerId: "signer-iframe-container",
  },
});
 
const publicKey = await client.targetPublicKey();

Returns

Promise<string>

A promise that resolves with the target public key when the iframe stamper is successfully initialized, or throws an error if the target public key is not supported.

Overrides

BaseSignerClient.targetPublicKey


validateMultiFactors(params): Promise<{
  bundle: string;
}>;

Defined in: account-kit/signer/src/client/base.ts:1276

Validates multiple MFA factors using the provided encrypted payload and MFA codes.

Parameters

ParameterTypeDescription

params

ValidateMultiFactorsParams

The validation parameters

Returns

Promise<{ bundle: string; }>

A promise that resolves to an object containing the credential bundle

Throws

If no credential bundle is returned from the server

Inherited from

BaseSignerClient.validateMultiFactors


verifyMfa(params): Promise<{
  multiFactors: MfaFactor[];
}>;

Defined in: account-kit/signer/src/client/base.ts:1211

Verifies a newly created MFA factor to complete the setup process.

Parameters

ParameterTypeDescription

params

VerifyMfaParams

The parameters required to verify the MFA factor

Returns

Promise<{ multiFactors: MfaFactor[]; }>

A promise that resolves to the updated list of MFA factors

Throws

If no user is authenticated

Inherited from

BaseSignerClient.verifyMfa


whoami(
   orgId?,
   idToken?,
   accessToken?): Promise<User>;

Defined in: account-kit/signer/src/client/base.ts:684

Retrieves the current user or fetches the user information if not already available.

Parameters

ParameterTypeDescription

orgId?

string

optional organization ID, defaults to the user's organization ID

idToken?

string

an OIDC ID token containing additional user information

accessToken?

string

an access token which if provided will be added to the user

Returns

Promise<User>

A promise that resolves to the user object

Throws

if no organization ID is provided when there is no current user

Inherited from

BaseSignerClient.whoami

Was this page helpful?