unlinkProfile

Disconnects an existing profile (authentication method) from the current user. Once disconnected, that profile can no longer be used to sign into the account.

Example

Unlinking an authentication method

import { inAppWallet } from "thirdweb/wallets";
const wallet = inAppWallet();
wallet.connect({ strategy: "google" });
const profiles = await getProfiles({
client,
});
const updatedProfiles = await unlinkProfile({
client,
profileToUnlink: profiles[0],
});

Unlinking an authentication for ecosystems

import { unlinkProfile } from "thirdweb/wallets/in-app";
const updatedProfiles = await unlinkProfile({
client,
ecosystem: {
id: "ecosystem.your-ecosystem-id",
},
profileToUnlink: profiles[0],
});

Unlinking an authentication method with account deletion

import { unlinkProfile } from "thirdweb/wallets/in-app";
const updatedProfiles = await unlinkProfile({
client,
profileToUnlink: profiles[0],
allowAccountDeletion: true, // This will delete the account if it's the last profile linked to the account
});
function unlinkProfile(args: UnlinkParams): Promise<Array<Profile>>;

Parameters

The object containing the profile that we want to unlink.

Type

let args: UnlinkParams;

Returns

let returnType: {
details: {
address?: Address;
email?: string;
id?: string;
phone?: string;
};
type: AuthOption;
};

A promise that resolves to the updated linked profiles.