Skip to content

feat(clerk-js): add update user metadata method#8537

Draft
brunol95 wants to merge 2 commits into
mainfrom
bruno/user-5297-add-update-user-metadata
Draft

feat(clerk-js): add update user metadata method#8537
brunol95 wants to merge 2 commits into
mainfrom
bruno/user-5297-add-update-user-metadata

Conversation

@brunol95
Copy link
Copy Markdown

Description

This PR introduces the updateMetadata method on the user object

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 12, 2026

🦋 Changeset detected

Latest commit: bdec0ff

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

This PR includes changesets to release 20 packages
Name Type
@clerk/clerk-js Minor
@clerk/shared Minor
@clerk/chrome-extension Patch
@clerk/expo Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/hono Patch
@clerk/localizations Patch
@clerk/msw Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/react Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/ui Patch
@clerk/vue 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
Copy Markdown

vercel Bot commented May 12, 2026

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment May 12, 2026 8:33pm

Request Review

@brunol95 brunol95 marked this pull request as draft May 12, 2026 20:33
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 1a43348e-1e7a-4426-aaad-31fb9a577c22

📥 Commits

Reviewing files that changed from the base of the PR and between a233ddb and bdec0ff.

📒 Files selected for processing (4)
  • .changeset/user-update-metadata.md
  • packages/clerk-js/src/core/resources/User.ts
  • packages/clerk-js/src/core/resources/__tests__/User.test.ts
  • packages/shared/src/types/user.ts

📝 Walkthrough

Walkthrough

This PR adds a new updateMetadata method to the UserResource interface and its User class implementation. The method accepts UpdateUserMetadataParams containing unsafeMetadata and issues a PATCH request to /me/metadata, using deep-merge semantics where nested keys are merged and keys set to null are removed. Two test cases verify that the PATCH request includes JSON-stringified unsafeMetadata and correctly handles null-valued keys. A changeset documents the minor version bumps for @clerk/clerk-js and @clerk/shared and clarifies that only unsafeMetadata is writable via this endpoint.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(clerk-js): add update user metadata method' clearly and directly describes the main change: introducing a new updateMetadata method for the user object in the clerk-js package.
Description check ✅ Passed The description is directly related to the changeset, clearly stating that the PR introduces the updateMetadata method on the user object, which matches the actual changes in the code and documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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


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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 12, 2026

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@8537

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@8537

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@8537

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@8537

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@8537

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@8537

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@8537

@clerk/express

npm i https://pkg.pr.new/@clerk/express@8537

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@8537

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@8537

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@8537

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@8537

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@8537

@clerk/react

npm i https://pkg.pr.new/@clerk/react@8537

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@8537

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@8537

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@8537

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@8537

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@8537

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@8537

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@8537

commit: bdec0ff

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant