Onboard users to web3
Onboard anyone with flexible auth options, secure account recovery, and smart account integration.
Any Auth Method
Use any of the built-in auth methods or bring your own.
Supports custom auth endpoints to integrate with your existing user base.
Prebuilt UI
Instant out of the box authentication with a prebuilt UI.
import { inAppWallet } from "thirdweb/wallets";
import { ConnectEmbed } from "thirdweb/react";
const wallets = [
inAppWallet(
// built-in auth methods
{
auth: {
options: [
"google",
"x",
"apple",
"discord",
"facebook",
"farcaster",
"telegram",
"coinbase",
"line",
"email",
"phone",
"passkey",
"guest",
],
},
},
// or bring your own auth endpoint
),
];
function App() {
return <ConnectEmbed client={client} wallets={wallets} />;
}
Custom UI
Customize the login UI and integrate with your existing user base. No limits on customizations and auth methods.
import { useState } from "react";
import { useConnect } from "thirdweb/react";
import {
inAppWallet,
preAuthenticate,
} from "thirdweb/wallets/in-app";
export function CustomLoginUi() {
const { connect, isConnecting, error } = useConnect();
const preLogin = async (email: string) => {
// send email verification code
await preAuthenticate({
client,
strategy: "email",
email,
});
};
const handleLogin = async (
email: string,
verificationCode: string,
) => {
// verify email with verificationCode and connect
connect(async () => {
const wallet = inAppWallet();
await wallet.connect({
client,
strategy: "email",
email,
verificationCode,
});
return wallet;
});
};
}
View Linked Profiles
View all web2 and web3 linked profiles for a user along with specific details for each profile type, including name, email, profile picture and more.
import { useProfiles } from "thirdweb/react";
function App() {
const { data: profiles } = useProfiles({
client,
});
return (
<div>
{profiles?.map((profile) => (
<div key={profile.type}>
<ProfileCard profile={profile} />
</div>
))}
</div>
);
}
Login to see linked profiles
Link another profile
Link a web2 or web3 profile to the connected account.
You can do this with hooks like shown here or from the prebuilt connect UI.
import { useLinkProfile } from "thirdweb/react";
function App() {
const {
mutate: linkProfile,
isPending,
error,
} = useLinkProfile();
const linkMetamask = () => {
// link any external wallet
linkProfile({
client: THIRDWEB_CLIENT,
strategy: "wallet",
wallet: createWallet("io.metamask"), // or any other wallet
chain: baseSepolia,
});
};
const linkPasskey = () => {
// link any web2 identity provider
linkProfile({
client: THIRDWEB_CLIENT,
strategy: "passkey", // or "email", "phone", etc.
type: "sign-up",
});
};
return (
<div>
<button onClick={linkMetamask}>Link Metamask</button>
<button onClick={linkPasskey}>Link Passkey</button>
</div>
);
}
Login to link another account.