Skip to content

feat: display author profile picture#556

Merged
danielroe merged 24 commits intonpmx-dev:mainfrom
Gugustinette:feat/display-author-profile-picture
Feb 2, 2026
Merged

feat: display author profile picture#556
danielroe merged 24 commits intonpmx-dev:mainfrom
Gugustinette:feat/display-author-profile-picture

Conversation

@Gugustinette
Copy link
Contributor

Resolves #435

How it works :

  • Find username email address by exploring its public packages metadata
  • If found, construct the Gravatar URL using it
  • Else, fallback to the previous solution with the username's initial

I cached the data for one day, I consider it way enough for the profile picture which realistically doesn't change many times a day.

@vercel
Copy link

vercel bot commented Jan 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 2, 2026 8:19am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 2, 2026 8:19am
npmx-lunaria Ignored Ignored Feb 2, 2026 8:19am

Request Review

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

for the cli we directly return the image, hashed.

not sure of the cost of doing the same, but there's the issue of: third party origins, and potential privacy concerns...

@Gugustinette
Copy link
Contributor Author

Oh ye I missed that.

The CLI has access to the user email which could be private, so I guess we should ignore this and keep the public-data-only solution.
Now for the image itself, I think it is better to use the Gravatar url directly, so its overall management is up to the Gravatar platform and the Gravatar user account.

But maybe we need the expertise of someone more qualified in this ? However I don't know who would be a good fit.

# Conflicts:
#	app/pages/~[username]/index.vue
@danielroe
Copy link
Member

a quick fix would be to add a server endpoint to proxy to gravatar, so we don't expose user IPs to a third party without consent

@Gugustinette
Copy link
Contributor Author

Oooh ok I did not think about it that way, that's on me 👀

Then we would add cache to it, which means if the user wants to change or delete its profile picture, it'll still be live on npmx for as long as the cache lives.
Is that ok ?

@danielroe
Copy link
Member

seems fine to me 👍

# Conflicts:
#	app/pages/~[username]/index.vue
#	shared/utils/constants.ts
@Gugustinette
Copy link
Contributor Author

Made the changes : the API endpoint now returns a data url with the image in base 64.
Thus the server is the one taking care of the request to Gravatar.

@trivikr
Copy link
Contributor

trivikr commented Feb 2, 2026

While browsing preview in three different browsers, the Gravatar of antfu seems to be getting cached for other users. It's not consistent, but I noticed it while viewing maintainers of vite.

@danielroe
Copy link
Member

thanks for the spot! a bit of code I hadn't tidied up

@danielroe danielroe added this pull request to the merge queue Feb 2, 2026
Merged via the queue into npmx-dev:main with commit ce58706 Feb 2, 2026
16 of 18 checks passed
@Gugustinette Gugustinette deleted the feat/display-author-profile-picture branch February 2, 2026 23:17
taskylizard pushed a commit to taskylizard/npmx.dev that referenced this pull request Feb 7, 2026
Co-authored-by: Daniel Roe <daniel@roe.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use author profile pictures

3 participants