RNAlchemySignerSingleton
Defined in: account-kit/rn-signer/src/signer.ts:22
Extends
BaseAlchemySigner
<RNSignerClient
>
Properties
Property | Type | Description | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
( | 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
Throws If no user is authenticated | |||||||||||||||||||||||||||||||||||||||
( | Handles OAuth authentication by augmenting the provided arguments with a type and performing authentication based on the OAuth mode (either using redirect or popup). | |||||||||||||||||||||||||||||||||||||||
( | Adds a passkey to the user’s account Example
| |||||||||||||||||||||||||||||||||||||||
( | Authenticate a user with either an email or a passkey and create a session for that user Example
| |||||||||||||||||||||||||||||||||||||||
() => | Clear a user session and log them out Example
| |||||||||||||||||||||||||||||||||||||||
( | 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
Param exportWallet parameters | |||||||||||||||||||||||||||||||||||||||
() => | ‐ | |||||||||||||||||||||||||||||||||||||||
() => | Retrieves the address of the current user by calling the | |||||||||||||||||||||||||||||||||||||||
() => | Gets the current logged in user If a user has an ongoing session, it will use that session and try to authenticate Example
Throws if there is no user logged in | |||||||||||||||||||||||||||||||||||||||
() => | Returns the signer configuration while fetching it if it’s not already initialized. | |||||||||||||||||||||||||||||||||||||||
() => | Retrieves the list of MFA factors configured for the current user. Example
Throws If no user is authenticated | |||||||||||||||||||||||||||||||||||||||
() => | Gets the current MFA status Example
| |||||||||||||||||||||||||||||||||||||||
() => | ‐ | |||||||||||||||||||||||||||||||||||||||
() => | ‐ | |||||||||||||||||||||||||||||||||||||||
‐ | ||||||||||||||||||||||||||||||||||||||||
() => | Retrieves a list of auth methods associated with the authenticated user. Throws Thrown if the user is not authenticated | |||||||||||||||||||||||||||||||||||||||
< | Allows you to subscribe to events emitted by the signer | |||||||||||||||||||||||||||||||||||||||
() => | Prepares the config needed to use popup-based OAuth login. This must be
called before calling 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
| |||||||||||||||||||||||||||||||||||||||
() => | Removes the email for the authenticated user, disallowing them from login with that email. Throws If the user is not authenticated | |||||||||||||||||||||||||||||||||||||||
( | Removes existing MFA factors by their IDs. Example
Throws If no user is authenticated | |||||||||||||||||||||||||||||||||||||||
( | Removes an OAuth provider by its ID if the user is authenticated. Throws Thrown if the user is not authenticated | |||||||||||||||||||||||||||||||||||||||
( | Removes a passkey from a user’s account Example
| |||||||||||||||||||||||||||||||||||||||
() => | Removes the phone number for the authenticated user, disallowing them from login with that phone number. Throws If the user is not authenticated | |||||||||||||||||||||||||||||||||||||||
( | Initiates an OTP (One-Time Password) verification process for a user contact.
Use this method before calling Throws If the user is not authenticated | |||||||||||||||||||||||||||||||||||||||
( | Sets the phone number for the authenticated user, allowing them to login with that
phone number. Throws If the user is not authenticated | |||||||||||||||||||||||||||||||||||||||
( | Signs an EIP-7702 Authorization and then returns the authorization with the signature. Example
| |||||||||||||||||||||||||||||||||||||||
| ‐ | |||||||||||||||||||||||||||||||||||||||
( | Signs a raw message after hashing it. Example
| |||||||||||||||||||||||||||||||||||||||
< | Serializes a transaction, signs it with a raw message, and then returns the serialized transaction with the signature. Example
| |||||||||||||||||||||||||||||||||||||||
< | Signs a typed message by first hashing it and then signing the hashed message using the Example
| |||||||||||||||||||||||||||||||||||||||
() => | Creates a new instance of Example
| |||||||||||||||||||||||||||||||||||||||
() => | This method lets you adapt your AlchemySigner to a viem LocalAccount, which will let you use the signer as an EOA directly. Example
Throws if your signer is not authenticated | |||||||||||||||||||||||||||||||||||||||
( | Verifies a newly created MFA factor to complete the setup process. Example
Throws If no user is authenticated |
Methods
getUser()
Call Signature
1 getUser(email): Promise< 2 | null 3 | { 4 orgId: string; 5 }>;
Defined in: account-kit/signer/dist/types/base.d.ts:350
Unauthenticated call to look up a user’s organizationId by email
Deprecated
Use getUser({ type: “email”, value: email }) instead
Example
1 import { AlchemyWebSigner } from "@account-kit/signer"; 2 3 const signer = new AlchemyWebSigner({ 4 client: { 5 connection: { 6 rpcUrl: "/api/rpc", 7 }, 8 iframeConfig: { 9 iframeContainerId: "alchemy-signer-iframe-container", 10 }, 11 }, 12 }); 13 14 const result = await signer.getUser("[email protected]");
Parameters
Parameter | Type | Description |
---|---|---|
|
| the email to lookup |
Returns
Promise
<
| null
| {
orgId
: string
;
}>
the organization id for the user if they exist
Inherited from
1 BaseAlchemySigner.getUser;
Call Signature
1 getUser(params): Promise< 2 | null 3 | { 4 orgId: string; 5 }>;
Defined in: account-kit/signer/dist/types/base.d.ts:377
Unauthenticated call to look up a user’s organizationId by email or phone
Example
1 import { AlchemyWebSigner } from "@account-kit/signer"; 2 3 const signer = new AlchemyWebSigner({ 4 client: { 5 connection: { 6 rpcUrl: "/api/rpc", 7 }, 8 iframeConfig: { 9 iframeContainerId: "alchemy-signer-iframe-container", 10 }, 11 }, 12 }); 13 14 const result = await signer.getUser({ type: "email", value: "[email protected]" });
Parameters
Parameter | Type |
---|---|
|
|
Returns
Promise
<
| null
| {
orgId
: string
;
}>
the organization id for the user if they exist
Inherited from
1 BaseAlchemySigner.getUser;
setEmail()
Call Signature
1 setEmail(email): Promise<string>;
Defined in: account-kit/signer/dist/types/base.d.ts:393
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
Parameter | Type | Description |
---|---|---|
|
| The email to set for the user |
Returns
Promise
<string
>
A promise that resolves to the updated email address
Throws
If the user is not authenticated
Inherited from
1 BaseAlchemySigner.setEmail;
Call Signature
1 setEmail(params): Promise<string>;
Defined in: account-kit/signer/dist/types/base.d.ts:404
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
Parameter | Type | Description |
---|---|---|
|
| An object containing the verification code |
Returns
Promise
<string
>
A promise that resolves to the updated email address
Throws
If the user is not authenticated
Inherited from
1 BaseAlchemySigner.setEmail;
validateMultiFactors()
1 validateMultiFactors(params): Promise<User>;
Defined in: account-kit/signer/dist/types/base.d.ts:763
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
1 import { AlchemyWebSigner } from "@account-kit/signer"; 2 3 const signer = new AlchemyWebSigner({ 4 client: { 5 connection: { 6 rpcUrl: "/api/rpc", 7 }, 8 iframeConfig: { 9 iframeContainerId: "alchemy-signer-iframe-container", 10 }, 11 }, 12 }); 13 14 // After MFA is required and user provides code 15 const user = await signer.validateMultiFactors({ 16 multiFactorCode: "123456", // 6-digit code from authenticator app 17 multiFactorId: "factor-id", 18 });
Parameters
Parameter | Type | Description |
---|---|---|
|
| Parameters for validating MFA factors |
Returns
Promise
<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
1 BaseAlchemySigner.validateMultiFactors;
getInstance()
1 static getInstance(params): RNAlchemySignerSingleton;
Defined in: account-kit/rn-signer/src/signer.ts:49
Parameters
Parameter | Type |
---|---|
| { |
| | |
| { |
|
|
|
|
Returns
RNAlchemySignerSingleton