Skip to content

feat(backend,clerk-js): Add providerUserId field to ExternalAccount#7777

Open
Jibaru wants to merge 1 commit intomainfrom
irueda/user-39-difference-between-google-oauth-data-and-other-providers
Open

feat(backend,clerk-js): Add providerUserId field to ExternalAccount#7777
Jibaru wants to merge 1 commit intomainfrom
irueda/user-39-difference-between-google-oauth-data-and-other-providers

Conversation

@Jibaru
Copy link
Contributor

@Jibaru Jibaru commented Feb 5, 2026

Description

Add providerUserId as a new field to the ExternalAccount resource to provide a clearer way to access the unique user ID from OAuth providers. This field is now the preferred way to retrieve provider user identifiers.

The existing externalId field is deprecated in favor of providerUserId for better clarity and consistency across the API. The externalId field remains available but is marked with @deprecated JSDoc annotation to guide developers toward the new field.

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:

Summary by CodeRabbit

  • New Features

    • Added providerUserId field to external accounts for accessing OAuth provider user identifiers.
  • Documentation

    • Deprecated externalId in favor of providerUserId.

Add providerUserId as a new field to the ExternalAccount resource to
provide a clearer way to access the unique user ID from OAuth
providers. This field is now the preferred way to retrieve provider
user identifiers.

The existing externalId field is deprecated in favor of providerUserId
for better clarity and consistency across the API. The externalId field
remains available but is marked with @deprecated JSDoc annotation to
guide developers toward the new field.
@changeset-bot
Copy link

changeset-bot bot commented Feb 5, 2026

🦋 Changeset detected

Latest commit: 374f251

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

This PR includes changesets to release 13 packages
Name Type
@clerk/clerk-js Minor
@clerk/backend Minor
@clerk/chrome-extension Patch
@clerk/expo Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/tanstack-react-start Patch
@clerk/testing 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 5, 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 Feb 5, 2026 7:08pm

Request Review

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 5, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7777

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 374f251

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

This pull request introduces a new providerUserId field to the ExternalAccount resource across both the @clerk/backend and @clerk/clerk-js packages. The existing externalId field is marked as deprecated in favor of the new field. The ExternalAccount.fromJSON method is updated to map the incoming provider_user_id data to the new providerUserId field. Test fixtures in the clerk-js package are also updated to include the provider_user_id field in mock data to reflect the API response structure changes.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding providerUserId field to ExternalAccount resource across backend and clerk-js packages.
Linked Issues check ✅ Passed The PR adds providerUserId field to ExternalAccount for clearer OAuth provider ID access and deprecates externalId, directly addressing USER-39's need for consistent provider-specific OAuth data formats.
Out of Scope Changes check ✅ Passed All changes are directly related to the stated objective of adding providerUserId and deprecating externalId; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


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.

@Jibaru Jibaru requested a review from a team February 5, 2026 19:15
Copy link
Member

@wobsoriano wobsoriano left a comment

Choose a reason for hiding this comment

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

🚀

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.

3 participants