# AlchemyWebSigner | @account-kit/signer

> A SmartAccountSigner that can be used with any SmartContractAccount

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

Defined in: [account-kit/signer/src/signer.ts:122](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/signer.ts#L122)

A SmartAccountSigner that can be used with any SmartContractAccount

## Extends

- [`BaseAlchemySigner`](BaseAlchemySigner)\<[`AlchemySignerWebClient`](AlchemySignerWebClient)>

## Constructors

### Constructor

```ts
new AlchemyWebSigner(params): AlchemyWebSigner;
```

Defined in: [account-kit/signer/src/signer.ts:146](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/signer.ts#L146)

Initializes an instance with the provided Alchemy signer parameters after parsing them with a schema.

#### Example

```ts
import { AlchemyWebSigner } from "@account-kit/signer";

const signer = new AlchemyWebSigner({
  client: {
    connection: {
      rpcUrl: "/api/rpc",
    },
    iframeConfig: {
      iframeContainerId: "alchemy-signer-iframe-container",
    },
  },
});
```

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `params`
      </td>

      <td>
        `Object`
      </td>

      <td>
        The parameters for the Alchemy signer, including the client and session configuration
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`AlchemyWebSigner`

#### Overrides

[`BaseAlchemySigner`](BaseAlchemySigner).[`constructor`](BaseAlchemySigner#constructor)

## Properties

<table>
  <thead>
    <tr>
      <th align="left">Property</th>
      <th align="left">Type</th>
      <th align="left">Default value</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        <a id="addmfa" /> `addMfa`
      </td>

      <td>
        (`params`) => `Promise`\<[`AddMfaResult`](../type-aliases/AddMfaResult)>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Initiates the setup of a new MFA factor for the current user.
        The factor will need to be verified using verifyMfa before it becomes active.

        **Example**

        ```ts
        import { AlchemyWebSigner } from "@account-kit/signer";

        const signer = new AlchemyWebSigner({
         client: {
           connection: {
             rpcUrl: "/api/rpc",
           },
           iframeConfig: {
             iframeContainerId: "alchemy-signer-iframe-container",
           },
         },
        });

        const result = await signer.addMfa({ multiFactorType: "totp" });
        // Result contains multiFactorTotpUrl to display as QR code
        ```

        **Throws**

        If no user is authenticated
      </td>
    </tr>

    <tr>
      <td>
        <a id="addpasskey" /> `addPasskey`
      </td>

      <td>
        (`params?`) => `Promise`\<`string`\[]>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Adds a passkey to the user's account

        **Example**

        ```ts
        import { AlchemyWebSigner } from "@account-kit/signer";

        const signer = new AlchemyWebSigner({
         client: {
           connection: {
             rpcUrl: "/api/rpc",
           },
           iframeConfig: {
             iframeContainerId: "alchemy-signer-iframe-container",
           },
         },
        });

        const result = await signer.addPasskey()
        ```
      </td>
    </tr>

    <tr>
      <td>
        <a id="authenticate" /> `authenticate`
      </td>

      <td>
        (`params`) => `Promise`\<[`User`](../type-aliases/User)>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Authenticate a user with either an email or a passkey and create a session for that user

        **Example**

        ```ts
        import { AlchemyWebSigner } from "@account-kit/signer";

        const signer = new AlchemyWebSigner({
         client: {
           connection: {
             rpcUrl: "/api/rpc",
           },
           iframeConfig: {
             iframeContainerId: "alchemy-signer-iframe-container",
           },
         },
        });

        const result = await signer.authenticate({
         type: "email",
         email: "foo@mail.com",
        });
        ```
      </td>
    </tr>

    <tr>
      <td>
        <a id="disconnect" /> `disconnect`
      </td>

      <td>
        () => `Promise`\<`void`>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Clear a user session and log them out

        **Example**

        ```ts
        import { AlchemyWebSigner } from "@account-kit/signer";

        const signer = new AlchemyWebSigner({
         client: {
           connection: {
             rpcUrl: "/api/rpc",
           },
           iframeConfig: {
             iframeContainerId: "alchemy-signer-iframe-container",
           },
         },
        });

        await signer.disconnect();
        ```
      </td>
    </tr>

    <tr>
      <td>
        <a id="exportprivatekey" /> `exportPrivateKey`
      </td>

      <td>
        (`opts`) => `Promise`\<`string`>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Exports a private key for a given account

        **Param**

        the parameters for the export
      </td>
    </tr>

    <tr>
      <td>
        <a id="exportprivatekeyencrypted" /> `exportPrivateKeyEncrypted`
      </td>

      <td>
        (`opts`) => `Promise`\<`ExportPrivateKeyEncryptedResult`>
      </td>

      <td>
        `undefined`
      </td>

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

        **Param**

        the parameters for the export
      </td>
    </tr>

    <tr>
      <td>
        <a id="exportwallet" /> `exportWallet`
      </td>

      <td>
        (`config`) => `Promise`\<`boolean`>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Used to export the wallet for a given user
        If the user is authenticated with an Email, this will return a seed phrase
        If the user is authenticated with a Passkey, this will return a private key

        **Example**

        ```ts
        import { AlchemyWebSigner } from "@account-kit/signer";

        const signer = new AlchemyWebSigner({
         client: {
           connection: {
             rpcUrl: "/api/rpc",
           },
           iframeConfig: {
             iframeContainerId: "alchemy-signer-iframe-container",
           },
         },
        });

        // the params passed to this are different based on the specific signer
        const result = signer.exportWallet()
        ```

        **Param**

        exportWallet parameters
      </td>
    </tr>

    <tr>
      <td>
        <a id="getaddress" /> `getAddress`
      </td>

      <td>
        () => `Promise`\<`` `0x${string}` ``>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Retrieves the address of the current user by calling the `whoami` method on `this.inner`.
      </td>
    </tr>

    <tr>
      <td>
        <a id="getmfafactors" /> `getMfaFactors`
      </td>

      <td>
        () => `Promise`\<\{ `multiFactors`: [`MfaFactor`](../type-aliases/MfaFactor)\[]; }>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Retrieves the list of MFA factors configured for the current user.

        **Example**

        ```ts
        import { AlchemyWebSigner } from "@account-kit/signer";

        const signer = new AlchemyWebSigner({
         client: {
           connection: {
             rpcUrl: "/api/rpc",
           },
           iframeConfig: {
             iframeContainerId: "alchemy-signer-iframe-container",
           },
         },
        });

        const { multiFactors } = await signer.getMfaFactors();
        ```

        **Throws**

        If no user is authenticated
      </td>
    </tr>

    <tr>
      <td>
        <a id="getpasskeystatus" /> `getPasskeyStatus`
      </td>

      <td>
        () => `Promise`\<\{ `isPasskeyAdded`: `boolean`; }>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        ‐
      </td>
    </tr>

    <tr>
      <td>
        <a id="inner" /> `inner`
      </td>

      <td>
        [`AlchemySignerWebClient`](AlchemySignerWebClient)
      </td>

      <td>
        `undefined`
      </td>

      <td>
        ‐
      </td>
    </tr>

    <tr>
      <td>
        <a id="removeemail" /> `removeEmail`
      </td>

      <td>
        () => `Promise`\<`void`>
      </td>

      <td>
        `undefined`
      </td>

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

        **Throws**

        If the user is not authenticated
      </td>
    </tr>

    <tr>
      <td>
        <a id="removemfa" /> `removeMfa`
      </td>

      <td>
        (`params`) => `Promise`\<\{ `multiFactors`: [`MfaFactor`](../type-aliases/MfaFactor)\[]; }>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Removes existing MFA factors by their IDs.

        **Example**

        ```ts
        import { AlchemyWebSigner } from "@account-kit/signer";

        const signer = new AlchemyWebSigner({
         client: {
           connection: {
             rpcUrl: "/api/rpc",
           },
           iframeConfig: {
             iframeContainerId: "alchemy-signer-iframe-container",
           },
         },
        });

        const result = await signer.removeMfa({
          multiFactorIds: ["factor-id-1", "factor-id-2"]
        });
        ```

        **Throws**

        If no user is authenticated
      </td>
    </tr>

    <tr>
      <td>
        <a id="removepasskey" /> `removePasskey`
      </td>

      <td>
        (`authenticatorId`) => `Promise`\<`void`>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Removes a passkey from a user's account

        **Example**

        ```ts
        import { AlchemyWebSigner } from "@account-kit/signer";

        const signer = new AlchemyWebSigner({
         client: {
           connection: {
             rpcUrl: "/api/rpc",
           },
           iframeConfig: {
             iframeContainerId: "alchemy-signer-iframe-container",
           },
         },
        });

        const authMethods = await signer.listAuthMethods();
        const passkey = authMethods.passkeys[0];

        const result = await signer.removePasskey(passkey.authenticatorId);
        ```
      </td>
    </tr>

    <tr>
      <td>
        <a id="removephonenumber" /> `removePhoneNumber`
      </td>

      <td>
        () => `Promise`\<`void`>
      </td>

      <td>
        `undefined`
      </td>

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

        **Throws**

        If the user is not authenticated
      </td>
    </tr>

    <tr>
      <td>
        <a id="sendverificationcode" /> `sendVerificationCode`
      </td>

      <td>
        (`type`, `contact`) => `Promise`\<\{ `otpId`: `string`; }>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Initiates an OTP (One-Time Password) verification process for a user contact.
        Use this method before calling `setEmail` with verification code to verify ownership of the email address.

        **Throws**

        If the user is not authenticated
      </td>
    </tr>

    <tr>
      <td>
        <a id="setphonenumber" /> `setPhoneNumber`
      </td>

      <td>
        (`params`) => `Promise`\<`void`>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Sets the phone number for the authenticated user, allowing them to login with that
        phone number. `sendVerificationCode` should be called first to obtain the code.

        **Throws**

        If the user is not authenticated
      </td>
    </tr>

    <tr>
      <td>
        <a id="signauthorization" /> `signAuthorization`
      </td>

      <td>
        (`unsignedAuthorization`) => `Promise`\<[`SignedAuthorization`](https://viem.sh)\<`number`>>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Signs an EIP-7702 Authorization and then returns the authorization with the signature.

        **Example**

        ```ts twoslash
        import { AlchemyWebSigner } from "@account-kit/signer";

        const signer = new AlchemyWebSigner({
         client: {
           connection: {
             rpcUrl: "/api/rpc",
           },
           iframeConfig: {
             iframeContainerId: "alchemy-signer-iframe-container",
           },
         },
        });

        const tx = await signer.signAuthorization({
         contractAddress: "0x1234123412341234123412341234123412341234",
         chainId: 1,
         nonce: 0,
        });
        ```
      </td>
    </tr>

    <tr>
      <td>
        <a id="signertype" /> `signerType`
      </td>

      <td>
        `"alchemy-signer"` | `"rn-alchemy-signer"`
      </td>

      <td>
        `"alchemy-signer"`
      </td>

      <td>
        ‐
      </td>
    </tr>

    <tr>
      <td>
        <a id="signmessage" /> `signMessage`
      </td>

      <td>
        (`msg`) => `Promise`\<`` `0x${string}` ``>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Signs a raw message after hashing it.

        **Example**

        ```ts
        import { AlchemyWebSigner } from "@account-kit/signer";

        const signer = new AlchemyWebSigner({
         client: {
           connection: {
             rpcUrl: "/api/rpc",
           },
           iframeConfig: {
             iframeContainerId: "alchemy-signer-iframe-container",
           },
         },
        });

        const signature = await signer.signMessage("Hello, world!");
        ```
      </td>
    </tr>

    <tr>
      <td>
        <a id="signtransaction" /> `signTransaction`
      </td>

      <td>
        \<`serializer`, `transaction`>(`transaction`, `options?`) => `Promise`\<[`IsNarrowable`](https://viem.sh)\<[`TransactionSerialized`](https://viem.sh)\<[`GetTransactionType`](https://viem.sh)\<`transaction`>>, `` `0x${string}` ``> *extends* `true` ? [`TransactionSerialized`](https://viem.sh)\<[`GetTransactionType`](https://viem.sh)\<`transaction`>> : `` `0x${string}` ``>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Serializes a transaction, signs it with a raw message, and then returns the serialized transaction with the signature.

        **Example**

        ```ts
        import { AlchemyWebSigner } from "@account-kit/signer";

        const signer = new AlchemyWebSigner({
         client: {
           connection: {
             rpcUrl: "/api/rpc",
           },
           iframeConfig: {
             iframeContainerId: "alchemy-signer-iframe-container",
           },
         },
        });

        const tx = await signer.signTransaction({
         to: "0x1234",
         value: "0x1234",
         data: "0x1234",
        });
        ```
      </td>
    </tr>

    <tr>
      <td>
        <a id="signtypeddata" /> `signTypedData`
      </td>

      <td>
        \<`TTypedData`, `TPrimaryType`>(`params`) => `Promise`\<`` `0x${string}` ``>
      </td>

      <td>
        `undefined`
      </td>

      <td>
        Signs a typed message by first hashing it and then signing the hashed message using the `signRawMessage` method.

        **Example**

        ```ts
        import { AlchemyWebSigner } from "@account-kit/signer";

        const signer = new AlchemyWebSigner({
         client: {
           connection: {
             rpcUrl: "/api/rpc",
           },
           iframeConfig: {
             iframeContainerId: "alchemy-signer-iframe-container",
           },
         },
        });

        const signature = await signer.signTypedData({
         domain: {},
         types: {},
         primaryType: "",
         message: {},
        });
        ```
      </td>
    </tr>

    <tr>
      <td>
        <a id="verifymfa" /> `verifyMfa`
      </td>

      <td>
        (`params`) => `Promise`\<\{ `multiFactors`: [`MfaFactor`](../type-aliases/MfaFactor)\[]; }>
      </td>

      <td>
        `undefined`
      </td>

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

        **Example**

        ```ts
        import { AlchemyWebSigner } from "@account-kit/signer";

        const signer = new AlchemyWebSigner({
         client: {
           connection: {
             rpcUrl: "/api/rpc",
           },
           iframeConfig: {
             iframeContainerId: "alchemy-signer-iframe-container",
           },
         },
        });

        const result = await signer.verifyMfa({
          multiFactorId: "factor-id",
          multiFactorCode: "123456" // 6-digit code from authenticator app
        });
        ```

        **Throws**

        If no user is authenticated
      </td>
    </tr>

  </tbody>
</table>

## Methods

### addOauthProvider()

```ts
addOauthProvider(args): Promise<OauthProviderInfo>;
```

Defined in: [account-kit/signer/src/base.ts:1280](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L1280)

Handles OAuth authentication by augmenting the provided arguments with a type and performing authentication based on the OAuth mode (either using redirect or popup).

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `args`
      </td>

      <td>
        `Omit`\<`Extract`\<`AuthParams`, \{ `type`: `"oauth"`; }>, `"type"`>
      </td>

      <td>
        Authentication parameters omitting the type, which will be set to "oauth"
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`Promise`\<[`OauthProviderInfo`](../type-aliases/OauthProviderInfo)>

A promise that resolves to an `OauthProviderInfo` object containing provider information and the ID token.

#### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`addOauthProvider`](BaseAlchemySigner#addoauthprovider)

---

### fetchConfig()

```ts
protected fetchConfig(): Promise<SignerConfig>;
```

Defined in: [account-kit/signer/src/base.ts:1902](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L1902)

#### Returns

`Promise`\<`SignerConfig`>

#### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`fetchConfig`](BaseAlchemySigner#fetchconfig)

---

### getAuthDetails()

```ts
getAuthDetails(): Promise<User>;
```

Defined in: [account-kit/signer/src/base.ts:479](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L479)

Gets the current logged in user
If a user has an ongoing session, it will use that session and
try to authenticate

#### Example

```ts
import { AlchemyWebSigner } from "@account-kit/signer";

const signer = new AlchemyWebSigner({
  client: {
    connection: {
      rpcUrl: "/api/rpc",
    },
    iframeConfig: {
      iframeContainerId: "alchemy-signer-iframe-container",
    },
  },
});

// throws if not logged in
const user = await signer.getAuthDetails();
```

#### Returns

`Promise`\<[`User`](../type-aliases/User)>

the current user

#### Throws

if there is no user logged in

#### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`getAuthDetails`](BaseAlchemySigner#getauthdetails)

---

### getConfig()

```ts
getConfig(): Promise<SignerConfig>;
```

Defined in: [account-kit/signer/src/base.ts:1894](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L1894)

Returns the signer configuration while fetching it if it's not already initialized.

#### Returns

`Promise`\<`SignerConfig`>

A promise that resolves to the signer configuration

#### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`getConfig`](BaseAlchemySigner#getconfig)

---

### getMfaStatus()

```ts
getMfaStatus(): object;
```

Defined in: [account-kit/signer/src/base.ts:719](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L719)

Gets the current MFA status

#### Example

```ts
import { AlchemyWebSigner } from "@account-kit/signer";

const signer = new AlchemyWebSigner({
  client: {
    connection: {
      rpcUrl: "/api/rpc",
    },
    iframeConfig: {
      iframeContainerId: "alchemy-signer-iframe-container",
    },
  },
});

const mfaStatus = signer.getMfaStatus();
if (mfaStatus === AlchemyMfaStatus.REQUIRED) {
  // Handle MFA requirement
}
```

#### Returns

`object`

The current MFA status

<table>
  <thead>
    <tr>
      <th align="left">Name</th>
      <th align="left">Type</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `mfaFactorId?`
      </td>

      <td>
        `string`
      </td>
    </tr>

    <tr>
      <td>
        `mfaRequired`
      </td>

      <td>
        `boolean`
      </td>
    </tr>

  </tbody>
</table>

#### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`getMfaStatus`](BaseAlchemySigner#getmfastatus)

---

### getUser()

Unauthenticated call to look up a user's organizationId by email or phone

#### Example

```ts
import { AlchemyWebSigner } from "@account-kit/signer";

const signer = new AlchemyWebSigner({
  client: {
    connection: {
      rpcUrl: "/api/rpc",
    },
    iframeConfig: {
      iframeContainerId: "alchemy-signer-iframe-container",
    },
  },
});

const result = await signer.getUser({ type: "email", value: "foo@mail.com" });
```

#### Param

the params to look up

#### Call Signature

```ts
getUser(email): Promise<
  | null
  | {
  orgId: string;
}>;
```

Defined in: [account-kit/signer/src/base.ts:752](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L752)

Unauthenticated call to look up a user's organizationId by email

##### Deprecated

Use getUser(\{ type: "email", value: email }) instead

##### Example

```ts
import { AlchemyWebSigner } from "@account-kit/signer";

const signer = new AlchemyWebSigner({
  client: {
    connection: {
      rpcUrl: "/api/rpc",
    },
    iframeConfig: {
      iframeContainerId: "alchemy-signer-iframe-container",
    },
  },
});

const result = await signer.getUser("foo@mail.com");
```

##### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `email`
      </td>

      <td>
        `string`
      </td>

      <td>
        the email to lookup
      </td>
    </tr>

  </tbody>
</table>

##### Returns

`Promise`\<
| `null`
| \{
`orgId`: `string`;
}>

the organization id for the user if they exist

##### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`getUser`](BaseAlchemySigner#getuser)

#### Call Signature

```ts
getUser(params): Promise<
  | null
  | {
  orgId: string;
}>;
```

Defined in: [account-kit/signer/src/base.ts:777](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L777)

Unauthenticated call to look up a user's organizationId by email or phone

##### Example

```ts
import { AlchemyWebSigner } from "@account-kit/signer";

const signer = new AlchemyWebSigner({
  client: {
    connection: {
      rpcUrl: "/api/rpc",
    },
    iframeConfig: {
      iframeContainerId: "alchemy-signer-iframe-container",
    },
  },
});

const result = await signer.getUser({ type: "email", value: "foo@mail.com" });
```

##### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `params`
      </td>

      <td>
        `GetUserParams`
      </td>
    </tr>

  </tbody>
</table>

##### Returns

`Promise`\<
| `null`
| \{
`orgId`: `string`;
}>

the organization id for the user if they exist

##### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`getUser`](BaseAlchemySigner#getuser)

---

### initConfig()

```ts
protected initConfig(): Promise<SignerConfig>;
```

Defined in: [account-kit/signer/src/base.ts:1884](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L1884)

#### Returns

`Promise`\<`SignerConfig`>

#### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`initConfig`](BaseAlchemySigner#initconfig)

---

### listAuthMethods()

```ts
listAuthMethods(): Promise<AuthMethods>;
```

Defined in: [account-kit/signer/src/base.ts:1325](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L1325)

Retrieves a list of auth methods associated with the authenticated user.

#### Returns

`Promise`\<[`AuthMethods`](../type-aliases/AuthMethods)>

A promise that resolves to an `AuthMethods` object containing the user's email, OAuth providers, and passkeys.

#### Throws

Thrown if the user is not authenticated

#### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`listAuthMethods`](BaseAlchemySigner#listauthmethods)

---

### on()

```ts
on<E>(event, listener): () => void;
```

Defined in: [account-kit/signer/src/base.ts:183](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L183)

Allows you to subscribe to events emitted by the signer

#### Type Parameters

<table>
  <thead>
    <tr>
      <th align="left">Type Parameter</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `E` *extends* keyof [`AlchemySignerEvents`](../type-aliases/AlchemySignerEvents)
      </td>
    </tr>
  </tbody>
</table>

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `event`
      </td>

      <td>
        `E`
      </td>

      <td>
        the event to subscribe to
      </td>
    </tr>

    <tr>
      <td>
        `listener`
      </td>

      <td>
        [`AlchemySignerEvents`](../type-aliases/AlchemySignerEvents)\[`E`]
      </td>

      <td>
        the function to run when the event is emitted
      </td>
    </tr>

  </tbody>
</table>

#### Returns

a function to remove the listener

```ts
(): void;
```

##### Returns

`void`

#### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`on`](BaseAlchemySigner#on)

---

### preparePopupOauth()

```ts
preparePopupOauth(): Promise<OauthConfig>;
```

Defined in: [account-kit/signer/src/base.ts:285](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L285)

Prepares the config needed to use popup-based OAuth login. This must be
called before calling `.authenticate` with params `{ type: "oauth", mode:
"popup" }`, and is recommended to be called on page load.

This method exists because browsers may prevent popups from opening unless
triggered by user interaction, and so the OAuth config must already have
been fetched at the time a user clicks a social login button.

#### Example

```ts
import { AlchemyWebSigner } from "@account-kit/signer";

const signer = new AlchemyWebSigner({
  client: {
    connection: {
      rpcUrl: "/api/rpc",
    },
    iframeConfig: {
      iframeContainerId: "alchemy-signer-iframe-container",
    },
  },
});

await signer.preparePopupOauth();
```

#### Returns

`Promise`\<[`OauthConfig`](../type-aliases/OauthConfig)>

the config which must be loaded before
using popup-based OAuth

#### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`preparePopupOauth`](BaseAlchemySigner#preparepopupoauth)

---

### removeOauthProvider()

```ts
removeOauthProvider(providerId): Promise<any>;
```

Defined in: [account-kit/signer/src/base.ts:1312](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L1312)

Removes an OAuth provider by its ID if the user is authenticated.

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `providerId`
      </td>

      <td>
        `string`
      </td>

      <td>
        The ID of the OAuth provider to be removed, as obtained from `listOauthProviders`
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`Promise`\<`any`>

A promise indicating the result of the removal process

#### Throws

Thrown if the user is not authenticated

#### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`removeOauthProvider`](BaseAlchemySigner#removeoauthprovider)

---

### setEmail()

Implementation for setEmail method.

#### Param

An object containing the verificationCode (or simply an email for legacy usage)

#### Call Signature

```ts
setEmail(email): Promise<string>;
```

Defined in: [account-kit/signer/src/base.ts:842](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L842)

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.
It is recommended to now use the email verification flow instead.

##### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `email`
      </td>

      <td>
        `string`
      </td>

      <td>
        The email to set for the user
      </td>
    </tr>

  </tbody>
</table>

##### Returns

`Promise`\<`string`>

A promise that resolves to the updated email address

##### Throws

If the user is not authenticated

##### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`setEmail`](BaseAlchemySigner#setemail)

#### Call Signature

```ts
setEmail(params): Promise<string>;
```

Defined in: [account-kit/signer/src/base.ts:854](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L854)

Uses a verification code to update a user's email, allowing them to login
with that email. `sendVerificationCode` should be called first to obtain
the code.

##### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `params`
      </td>

      <td>
        `VerificationParams`
      </td>

      <td>
        An object containing the verification code
      </td>
    </tr>

  </tbody>
</table>

##### Returns

`Promise`\<`string`>

A promise that resolves to the updated email address

##### Throws

If the user is not authenticated

##### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`setEmail`](BaseAlchemySigner#setemail)

---

### toSolanaSigner()

```ts
toSolanaSigner(): SolanaSigner;
```

Defined in: [account-kit/signer/src/base.ts:1143](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L1143)

Creates a new instance of `SolanaSigner` using the provided inner value.
This requires the signer to be authenticated first

#### Example

```ts
import { AlchemyWebSigner } from "@account-kit/signer";

const signer = new AlchemyWebSigner({
  client: {
    connection: {
      rpcUrl: "/api/rpc",
    },
    iframeConfig: {
      iframeContainerId: "alchemy-signer-iframe-container",
    },
  },
});

const solanaSigner = signer.toSolanaSigner();
```

#### Returns

[`SolanaSigner`](SolanaSigner)

A new instance of `SolanaSigner`

#### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`toSolanaSigner`](BaseAlchemySigner#tosolanasigner)

---

### toViemAccount()

```ts
toViemAccount(): Object;
```

Defined in: [account-kit/signer/src/base.ts:1099](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L1099)

This method lets you adapt your AlchemySigner to a viem LocalAccount, which
will let you use the signer as an EOA directly.

#### Example

```ts
import { AlchemyWebSigner } from "@account-kit/signer";

const signer = new AlchemyWebSigner({
  client: {
    connection: {
      rpcUrl: "/api/rpc",
    },
    iframeConfig: {
      iframeContainerId: "alchemy-signer-iframe-container",
    },
  },
});

const account = signer.toViemAccount();
```

#### Returns

`Object`

a LocalAccount object that can be used with viem's wallet client

#### Throws

if your signer is not authenticated

#### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`toViemAccount`](BaseAlchemySigner#toviemaccount)

---

### validateMultiFactors()

```ts
validateMultiFactors(params): Promise<User>;
```

Defined in: [account-kit/signer/src/base.ts:1825](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/signer/src/base.ts#L1825)

Validates MFA factors that were required during authentication.
This function should be called after MFA is required and the user has provided their MFA code.
It completes the authentication process by validating the MFA factors and completing the auth bundle.

#### Example

```ts
import { AlchemyWebSigner } from "@account-kit/signer";

const signer = new AlchemyWebSigner({
  client: {
    connection: {
      rpcUrl: "/api/rpc",
    },
    iframeConfig: {
      iframeContainerId: "alchemy-signer-iframe-container",
    },
  },
});

// After MFA is required and user provides code
const user = await signer.validateMultiFactors({
  multiFactorCode: "123456", // 6-digit code from authenticator app
  multiFactorId: "factor-id",
});
```

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `params`
      </td>

      <td>
        [`ValidateMultiFactorsArgs`](../type-aliases/ValidateMultiFactorsArgs)
      </td>

      <td>
        Parameters for validating MFA factors
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`Promise`\<[`User`](../type-aliases/User)>

A promise that resolves to the authenticated user

#### Throws

If there is no pending MFA context or if orgId is not found

#### Inherited from

[`BaseAlchemySigner`](BaseAlchemySigner).[`validateMultiFactors`](BaseAlchemySigner#validatemultifactors)