diff --git a/.changeset/apple-profile-name-picture.md b/.changeset/apple-profile-name-picture.md new file mode 100644 index 00000000000..b34d4708507 --- /dev/null +++ b/.changeset/apple-profile-name-picture.md @@ -0,0 +1,5 @@ +--- +"thirdweb": minor +--- + +Add optional `name` and `picture` fields to `Profile` type to support additional OAuth provider data (Google, Apple, etc.). The UI now displays the user's name when available from OAuth providers, improving Apple Sign In compliance. diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx index b2b1eaf0e3d..11343376db3 100644 --- a/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx +++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx @@ -24,6 +24,11 @@ import { MenuButton } from "../MenuButton.js"; import type { WalletDetailsModalScreen } from "./types.js"; function getProfileDisplayName(profile: Profile) { + // Prefer name if available (from OAuth providers like Google/Apple) + if (profile.details.name) { + return profile.details.name; + } + switch (true) { case profile.type === "email" && profile.details.email !== undefined: return profile.details.email; diff --git a/packages/thirdweb/src/wallets/in-app/core/authentication/types.ts b/packages/thirdweb/src/wallets/in-app/core/authentication/types.ts index f91eb56040e..ef3bb3366a7 100644 --- a/packages/thirdweb/src/wallets/in-app/core/authentication/types.ts +++ b/packages/thirdweb/src/wallets/in-app/core/authentication/types.ts @@ -124,6 +124,8 @@ export type Profile = { email?: string; phone?: string; address?: Address; + name?: string; + picture?: string; }; };