linkProfile

Connects a new profile (authentication method) to the current user. The connected profile can be any valid in-app wallet including email, phone, passkey, etc. The inputs mirror those used when authenticating normally.

When a profile is linked to the account, that profile can then be used to sign into the account.

This method is only available for in-app wallets.

Example

const wallet = inAppWallet();
await wallet.connect({ strategy: "google" });
const profiles = await linkProfile(wallet, { strategy: "discord" });
function linkProfile(
wallet: Wallet<"inApp">,
auth: MultiStepAuthArgsType | SingleStepAuthArgsType,
): Promise<Array<Profile>>;

Parameters

The wallet to link an additional profile to.

Type

let wallet: Wallet<"inApp">;

The authentications options to add the new profile.

Type

let auth: MultiStepAuthArgsType | SingleStepAuthArgsType;

Returns

let returnType: Promise<Array<Profile>>;

A promise that resolves to the currently linked profiles when the connection is successful.