Skip to content

Comments

[SDK] Add name and picture fields to Profile type for Apple Sign In compliance#8681

Open
AKSHEXXXX wants to merge 1 commit intothirdweb-dev:mainfrom
AKSHEXXXX:sdk/fix-apple-signin-profile-fields
Open

[SDK] Add name and picture fields to Profile type for Apple Sign In compliance#8681
AKSHEXXXX wants to merge 1 commit intothirdweb-dev:mainfrom
AKSHEXXXX:sdk/fix-apple-signin-profile-fields

Conversation

@AKSHEXXXX
Copy link

@AKSHEXXXX AKSHEXXXX commented Feb 21, 2026

Summary

Add optional name and picture fields to the Profile type to support additional OAuth provider data, improving Apple Sign In compliance.

Fixes #8673

Changes

  • ✅ Add optional name and picture fields to Profile type in types.ts
  • ✅ Update getProfileDisplayName() to prioritize displaying user's full name when available
  • ✅ Add changeset documenting the minor version bump

Details

Type Changes

The Profile type now includes optional name and picture strings in details, matching what Google already returns and what Apple should return on first authorization.

UI Improvements

The LinkedProfilesScreen now prioritizes displaying the user's name from OAuth providers (Google, Apple) instead of falling back to email addresses immediately.

Why These Changes Matter

This resolves the Apple App Store rejection (Guideline 4.8) by:

  1. Type Support: The SDK now has proper TypeScript types to handle name and picture data from OAuth providers
  2. UI Display: When the backend provides the user's full name, the UI will display it
  3. Backward Compatible: Since the fields are optional, existing implementations continue to work

Backend Note

For complete resolution of #8673, the backend (embedded-wallet.thirdweb.com) must also capture Apple's fullName during first authorization and return it in the linkedAccounts API response. This SDK change creates the infrastructure to receive and display that data.

Testing

  • TypeScript types compile without errors
  • No linting errors in modified files
  • Existing tests remain compatible (fields are optional)
  • Backward compatible with existing Profile usages

PR-Codex overview

This PR introduces optional name and picture fields to the Profile type, enhancing support for OAuth provider data, particularly for Apple and Google. It also updates the UI to display the user's name when available, improving compliance with Apple Sign In.

Detailed summary

  • Added optional name and picture fields to the Profile type in packages/thirdweb/src/wallets/in-app/core/authentication/types.ts.
  • Updated getProfileDisplayName function in packages/thirdweb/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx to prioritize name from OAuth providers.
  • Updated changelog in .changeset/apple-profile-name-picture.md to reflect changes.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features
    • Profile data now supports optional name and picture fields from OAuth providers like Google and Apple.
    • The user interface has been updated to display the user's name when this information is available from OAuth authentication sources.

…ompliance

- Add optional name and picture fields to Profile type to support OAuth provider data
- Update LinkedProfilesScreen to display user's name when available
- Fixes thirdweb-dev#8673: Apple App Store rejection due to missing display name

The Profile type now includes name and picture fields that OAuth providers
like Google and Apple can populate. The UI prioritizes displaying the user's
full name when available, improving Apple Sign In compliance with App Store
Guideline 4.8.
Copilot AI review requested due to automatic review settings February 21, 2026 22:20
@AKSHEXXXX AKSHEXXXX requested review from a team as code owners February 21, 2026 22:20
@changeset-bot
Copy link

changeset-bot bot commented Feb 21, 2026

🦋 Changeset detected

Latest commit: 535d0e7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
thirdweb Minor
@thirdweb-dev/nebula Patch
@thirdweb-dev/wagmi-adapter Patch
wagmi-inapp Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Feb 21, 2026

@akshatextreme is attempting to deploy a commit to the thirdweb Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Feb 21, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 21, 2026

Walkthrough

This PR extends the Profile type to include optional name and picture fields for OAuth provider metadata (Google, Apple), and updates the UI to prioritize displaying the name from these fields when available.

Changes

Cohort / File(s) Summary
Type Definitions
packages/thirdweb/src/wallets/in-app/core/authentication/types.ts, .changeset/apple-profile-name-picture.md
Added optional name?: string and picture?: string fields to Profile.details to align with OAuth provider data (Google, Apple); documented as a minor release.
UI Layer
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx
Updated getProfileDisplayName function to prioritize profile.details.name when present before falling back to existing display name logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding name and picture fields to the Profile type for Apple Sign In compliance.
Description check ✅ Passed The description is comprehensive and well-structured, clearly outlining the summary, changes, details, rationale, and testing approach; it follows repository conventions.
Linked Issues check ✅ Passed The PR fully implements the SDK-side requirements from #8673: adds optional name and picture fields to Profile type and updates UI to prioritize displaying names from OAuth providers.
Out of Scope Changes check ✅ Passed All changes are scoped to the linked issue #8673: type definitions, UI display logic, and changeset documentation directly address the Apple Sign In compliance requirements.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds optional name and picture fields to the Profile type to improve Apple Sign In compliance and better support OAuth provider data. The changes enable the SDK to receive and display user names from OAuth providers (Google, Apple) instead of falling back to email addresses.

Changes:

  • Added optional name and picture fields to the Profile.details type in the in-app wallet authentication system
  • Updated getProfileDisplayName() to prioritize displaying the user's full name when available from OAuth providers
  • Added changeset documenting the minor version bump with appropriate description

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/thirdweb/src/wallets/in-app/core/authentication/types.ts Added optional name and picture fields to Profile.details type
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx Updated display name logic to prioritize user's full name from OAuth providers
.changeset/apple-profile-name-picture.md Added changeset documenting the minor version bump

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +27 to +30
// Prefer name if available (from OAuth providers like Google/Apple)
if (profile.details.name) {
return profile.details.name;
}
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new name field handling in getProfileDisplayName looks good and will correctly prioritize the user's full name from OAuth providers. However, there are no test cases added to verify this new behavior. Consider adding a test case that verifies when a profile has both name and email (e.g., for a Google profile), the name is displayed rather than the email address.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx (2)

151-187: profile.details.picture is unused in the avatar rendering chain.

The new picture field on Profile.details (e.g., populated by Google/Apple OAuth) is never consulted here. The fallback chain jumps straight from socialProfiles avatar → address Blobbie → type icons, so a provider-supplied picture URL is silently dropped.

Consider inserting a fallback that uses profile.details.picture when socialProfiles returns no avatar:

♻️ Proposed enhancement
 {socialProfiles?.some((p) => p.avatar) ? (
   <Img
     client={client}
     height={iconSize.lg}
     loading="eager"
     src={socialProfiles?.find((p) => p.avatar)?.avatar}
     style={{ borderRadius: "100%" }}
     width={iconSize.lg}
   />
+) : profile.details.picture ? (
+  <Img
+    client={client}
+    height={iconSize.lg}
+    loading="eager"
+    src={profile.details.picture}
+    style={{ borderRadius: "100%" }}
+    width={iconSize.lg}
+  />
 ) : profile.details.address !== undefined ? (
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/thirdweb/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx`
around lines 151 - 187, The avatar rendering ignores profile.details.picture;
update the conditional chain in LinkedProfilesScreen so that after checking
socialProfiles for an avatar (socialProfiles?.some((p) => p.avatar) and src from
socialProfiles?.find...), you fall back to profile.details.picture (use Img with
src={profile.details.picture}) before falling back to Blobbie
(profile.details.address) and the type icons (FingerPrintIcon, EmailIcon,
PhoneIcon, getSocialIcon). Ensure you reference the existing Img, Blobbie,
profile.details.picture, socialProfiles, and getSocialIcon symbols when adding
this additional fallback.

26-49: getProfileDisplayName is missing an explicit return type annotation.

The switch(true) pattern doesn't narrow profile.details.email / profile.details.phone in case bodies, so TypeScript infers the return as string | undefined. Adding an explicit return type makes the intent clear and surfaces potential undefined paths.

♻️ Proposed fix
-function getProfileDisplayName(profile: Profile) {
+function getProfileDisplayName(profile: Profile): string {
   // 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;
+      return profile.details.email as string;
     case profile.type === "google" && profile.details.email !== undefined:
-      return profile.details.email;
+      return profile.details.email as string;
     case profile.type === "phone" && profile.details.phone !== undefined:
-      return profile.details.phone;
+      return profile.details.phone as string;
     case profile.details.address !== undefined:
       return shortenAddress(profile.details.address, 6);
     case (profile.type as string) === "cognito" &&
       profile.details.email !== undefined:
-      return profile.details.email;
+      return profile.details.email as string;
     case (profile.type as string).toLowerCase() === "custom_auth_endpoint":
       return "Custom Profile";
     default:
       return profile.type.slice(0, 1).toUpperCase() + profile.type.slice(1);
   }
 }

As per coding guidelines: "Write idiomatic TypeScript with explicit function declarations and return types."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/thirdweb/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx`
around lines 26 - 49, Add an explicit return type to getProfileDisplayName
(change signature to getProfileDisplayName(profile: Profile): string) and
replace the switch(true) pattern with an if/else chain so TypeScript can
properly narrow profile.details.email/phone before returning them; keep the same
logic (check profile.details.name, then email/phone/address via shortenAddress,
cognito, custom_auth_endpoint, then default capitalized profile.type) to
guarantee every code path returns a string.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@packages/thirdweb/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx`:
- Around line 151-187: The avatar rendering ignores profile.details.picture;
update the conditional chain in LinkedProfilesScreen so that after checking
socialProfiles for an avatar (socialProfiles?.some((p) => p.avatar) and src from
socialProfiles?.find...), you fall back to profile.details.picture (use Img with
src={profile.details.picture}) before falling back to Blobbie
(profile.details.address) and the type icons (FingerPrintIcon, EmailIcon,
PhoneIcon, getSocialIcon). Ensure you reference the existing Img, Blobbie,
profile.details.picture, socialProfiles, and getSocialIcon symbols when adding
this additional fallback.
- Around line 26-49: Add an explicit return type to getProfileDisplayName
(change signature to getProfileDisplayName(profile: Profile): string) and
replace the switch(true) pattern with an if/else chain so TypeScript can
properly narrow profile.details.email/phone before returning them; keep the same
logic (check profile.details.name, then email/phone/address via shortenAddress,
cognito, custom_auth_endpoint, then default capitalized profile.type) to
guarantee every code path returns a string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Sign in with Apple: user name missing from profile.details

2 participants