Skip to content

fix(backend): expose externalAccountId on ExternalAccount resource - #8995

Merged
jacekradko merged 1 commit into
mainfrom
jacek/backend-external-account-id
Jun 26, 2026
Merged

fix(backend): expose externalAccountId on ExternalAccount resource#8995
jacekradko merged 1 commit into
mainfrom
jacek/backend-external-account-id

Conversation

@jacekradko

@jacekradkojacekradko commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

The backend ExternalAccount.id is the idn_ identification id for Google and Facebook accounts, so handing it to users.deleteUserExternalAccount() (which wants the eac_ id) returns a 404. This adds an optional externalAccountId that carries the eac_ value.

The part worth knowing is why it's optional. The Backend API only returns external_account_id for Google and Facebook accounts, where id is the idn_ value. Every other provider already returns id as the eac_ id and no external_account_id. So the deletable id is externalAccountId ?? id, never externalAccountId on its own, and the JSDoc plus changeset say as much. The getUser fixture now carries both a google_account and a generic external_account entry so the test asserts both shapes.

This is an alternative to #8982, which mapped the same field but typed it as a required string and pointed callers at externalAccountId directly, which would 404 for every non-Google/Facebook account.

Fixes#7936
Fixes#7584

Summary by CodeRabbit

  • Bug Fixes

    • Improved how external account IDs are returned for linked social accounts, so account deletion and related actions use the correct identifier.
    • Kept existing behavior for other providers while making the ID mapping more consistent.
  • Tests

    • Added coverage for provider-specific external account ID handling to verify the updated behavior.

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8f9546d

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendPatch
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJun 25, 2026 12:49pm
swingsetReadyReadyPreview, CommentJun 25, 2026 12:49pm

Request Review

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ec22195-d655-48ad-8a14-442afebb4238

📥 Commits

Reviewing files that changed from the base of the PR and between afef28f and 8f9546d.

📒 Files selected for processing (6)
  • .changeset/backend-external-account-id.md
  • packages/backend/src/api/__tests__/factory.test.ts
  • packages/backend/src/api/resources/ExternalAccount.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/api/resources/__tests__/ExternalAccount.test.ts
  • packages/backend/src/fixtures/user.json
✅ Files skipped from review due to trivial changes (2)
  • .changeset/backend-external-account-id.md
  • packages/backend/src/api/tests/factory.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/backend/src/api/resources/ExternalAccount.ts
  • packages/backend/src/api/resources/tests/ExternalAccount.test.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/fixtures/user.json

📝 Walkthrough

Walkthrough

ExternalAccount now carries an optional externalAccountId from external_account_id, while preserving existing id and identificationId mapping. Tests, fixtures, and a changeset were updated for provider-specific external account IDs.

Changes

External account ID mapping

Layer / File(s)Summary
External account contract
packages/backend/src/api/resources/JSON.ts, packages/backend/src/api/resources/ExternalAccount.ts
ExternalAccountJSON adds external_account_id, and ExternalAccount stores it as externalAccountId while reading it from data.external_account_id.
Provider mapping coverage
packages/backend/src/api/__tests__/factory.test.ts, packages/backend/src/api/resources/__tests__/ExternalAccount.test.ts, packages/backend/src/fixtures/user.json, .changeset/backend-external-account-id.md
Tests and fixtures assert the provider-specific mapping for id, identificationId, and externalAccountId, and the changeset records the patch release.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 I hopped through IDs, both new and old,
idn_ and eac_ now shine like gold.
Fixtures bounce, tests nibble neat,
The mapping now feels snug and sweet.
Hoppity hop—what a tidy treat!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly summarizes the main backend ExternalAccount change and is concise.
Linked Issues check✅ PassedThe PR exposes optional externalAccountId while preserving id behavior, matching the linked bug fixes and compatibility requirements.
Out of Scope Changes check✅ PassedAll edits support the ExternalAccount ID fix through code, tests, fixtures, and a changeset; no unrelated changes are present.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@pkg-pr-new

pkg-pr-newBot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@8995

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@8995

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@8995

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 8f9546d

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-06-26T12:40:31.956Z

Summary

MetricCount
Packages analyzed19
Packages with changes3
🔴 Breaking changes5
🟡 Non-breaking changes3
🟢 Additions2

Warning
5 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (5)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/shared./typesOrganizationDomainOwnershipVerification.status
@clerk/shared./typesOrganizationDomainOwnershipVerificationJSON.status
@clerk/shared./typesOrganizationDomainOwnershipVerificationStatus
@clerk/shared./typesOrganizationDomainOwnershipVerificationStrategy
@clerk/shared./typesOrganizationDomainVerificationStatus

@clerk/shared

Version: 4.22.0 → 4.21.0
Recommended bump: MAJOR

Subpath ./types

🔴 Breaking Changes (5)

Changed: OrganizationDomainOwnershipVerification.status
- status: OrganizationDomainOwnershipVerificationStatus;+ status: OrganizationDomainVerificationStatus;

Static analyzer: Breaking change in property OrganizationDomainOwnershipVerification.status: Type changed: import("@clerk/shared").OrganizationDomainOwnershipVerificationStatusimport("@clerk/shared").OrganizationDomainVerificationStatus

🤖 AI review (confirmed) (85%): The status field on OrganizationDomainOwnershipVerification changed from OrganizationDomainOwnershipVerificationStatus ('expired'|'unverified'|'verified') to OrganizationDomainVerificationStatus ('unverified'|'verified'), dropping 'expired'; consumers reading this output field that branch on 'expired' will hit an unhandled case or a type-check error.

Migration: Update any switch/if statements that handle the 'expired' status on OrganizationDomainOwnershipVerification.status to use OrganizationDomainVerificationStatus ('unverified' | 'verified') and remove the 'expired' branch.

Changed: OrganizationDomainOwnershipVerificationJSON.status
- status: OrganizationDomainOwnershipVerificationStatus;+ status: OrganizationDomainVerificationStatus;

Static analyzer: Breaking change in property OrganizationDomainOwnershipVerificationJSON.status: Type changed: import("@clerk/shared").OrganizationDomainOwnershipVerificationStatusimport("@clerk/shared").OrganizationDomainVerificationStatus

🤖 AI review (confirmed) (85%): Same narrowing as b73ffcd5d145 applied to OrganizationDomainOwnershipVerificationJSON.status; the 'expired' variant is removed, breaking consumers that read or switch on this JSON field.

Migration: Update consumers reading OrganizationDomainOwnershipVerificationJSON.status to only handle 'unverified' | 'verified' and remove handling of 'expired'.

Changed: OrganizationDomainOwnershipVerificationStatus
- type OrganizationDomainOwnershipVerificationStatus = 'unverified' | 'verified' | 'expired';

Static analyzer: Removed type alias OrganizationDomainOwnershipVerificationStatus

🤖 AI review (confirmed) (95%): The exported type alias OrganizationDomainOwnershipVerificationStatus has been removed entirely; any consumer that imported or referenced it will fail to compile.

Migration: Replace usages of OrganizationDomainOwnershipVerificationStatus with OrganizationDomainVerificationStatus ('unverified' | 'verified').

Changed: OrganizationDomainOwnershipVerificationStrategy
- type OrganizationDomainOwnershipVerificationStrategy = 'txt' | 'legacy' | 'manual_override' | 'parent_domain';+ type OrganizationDomainOwnershipVerificationStrategy = 'txt' | 'legacy' | 'manual_override';

Static analyzer: Breaking change in type alias OrganizationDomainOwnershipVerificationStrategy: Type changed: 'legacy'|'manual_override'|'parent_domain'|'txt''legacy'|'manual_override'|'txt'

🤖 AI review (confirmed) (90%): The 'parent_domain' variant was removed from OrganizationDomainOwnershipVerificationStrategy; consumers that read this output field and handle 'parent_domain' (e.g., in a switch statement) will have a type error with exhaustiveness checks, and runtime values of 'parent_domain' are no longer typed.

Migration: Remove 'parent_domain' from any exhaustive checks or type annotations referencing OrganizationDomainOwnershipVerificationStrategy.

Changed: OrganizationDomainVerificationStatus
- type OrganizationDomainVerificationStatus = 'unverified' | 'verified' | 'failed' | 'expired';+ type OrganizationDomainVerificationStatus = 'unverified' | 'verified';

Static analyzer: Breaking change in type alias OrganizationDomainVerificationStatus: Type changed: 'expired'|'failed'|'unverified'|'verified''unverified'|'verified'

🤖 AI review (confirmed) (90%): The 'expired' and 'failed' variants were removed from OrganizationDomainVerificationStatus; consumers reading output fields typed with this union that handle those variants will get type errors under strict/exhaustive checks.

Migration: Remove 'expired' and 'failed' branches from any exhaustive switch/if statements over OrganizationDomainVerificationStatus.

🟡 Non-breaking Changes (1)

Modified: __internal_LocalizationResource
// ... 1297 unchanged lines elided ...
domainCard: {
badge__verified: LocalizationValue;
badge__unverified: LocalizationValue;
- badge__expired: LocalizationValue;
verifiedAtLabel: LocalizationValue<'date'>;
- expiredAtLabel: LocalizationValue<'date'>;- expiredLabel: LocalizationValue;- verifyAgainButton: LocalizationValue;
removeButtonTooltip__lastVerifiedDomain: LocalizationValue;
removeButtonTooltip__lastVerifiedDomainActive: LocalizationValue;
txtRecord: {
// ... 639 unchanged lines elided ...

Static analyzer: Breaking change in type alias __internal_LocalizationResource: Type changed: {locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…{locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…

🤖 AI review (reclassified as non-breaking) (55%): The diff elides 1867 vs 1863 lines suggesting ~4 lines were removed, but __internal_LocalizationResource is used only as an input to DeepLocalizationWithoutObjects via LocalizationResource extends DeepPartial<...>, meaning consumers supply partial overrides; removing optional keys from an output/template type they partially implement is unlikely to break well-typed consumers. Without the full diffed lines it is impossible to be certain, so confidence is low.


@clerk/backend

Version: 3.8.4 → 3.8.3
Recommended bump: MINOR

🟡 Non-breaking Changes (1)

Modified: ExternalAccount.undefined

// ... 12 unchanged lines elided ...
phoneNumber: string | null, publicMetadata: (Record<string, unknown> | null) | undefined, label: string | null, - verification: Verification | null);+ verification: Verification | null, + externalAccountId?: string | undefined);

Static analyzer: Modified constructor ExternalAccount.undefined: Optional parameter externalAccountId was added

🤖 AI review (confirmed) (95%): Adding an optional parameter externalAccountId? at the end of the constructor signature does not break existing callers, since all prior call sites remain valid without providing the new argument.

🟢 Additions (2)

Added: ExternalAccount.externalAccountId

+ readonly externalAccountId?: string | undefined;

Added property ExternalAccount.externalAccountId

Added: ExternalAccountJSON.external_account_id

+ external_account_id?: string;

Added property ExternalAccountJSON.external_account_id


@clerk/ui

Version: 1.23.0 → 1.22.0
Recommended bump: MINOR

Subpath ./internal

🟡 Non-breaking Changes (1)

Modified: ElementsConfig
// ... 490 unchanged lines elided ...
configureSSOVerifyDomainErrorSubtitle: WithOptions;
configureSSOVerifyDomainList: WithOptions;
configureSSOVerifyDomainSuggestion: WithOptions;
- configureSSOVerifyDomainCard: WithOptions<'verified' | 'unverified' | 'expired'>;- configureSSOVerifyDomainCardBadge: WithOptions<'verified' | 'unverified' | 'expired'>;+ configureSSOVerifyDomainCard: WithOptions<'verified' | 'unverified'>;+ configureSSOVerifyDomainCardBadge: WithOptions<'verified' | 'unverified'>;
configureSSOVerifyDomainCardRemoveButton: WithOptions;
configureSSOVerifyDomainCardTxtRecord: WithOptions;
configureSSOVerifyDomainCardTxtRecordValue: WithOptions;
- configureSSOVerifyDomainCardExpired: WithOptions;
configureSSOEmailVerificationForm: WithOptions<string>;
configureSSOEmailVerificationIcon: WithOptions<string>;
configureSSOEmailVerificationTitle: WithOptions<string>;
// ... 51 unchanged lines elided ...

Static analyzer: Breaking change in type alias ElementsConfig: Type changed: {button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…{button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…

🤖 AI review (reclassified as non-breaking) (85%): The elided diff shows 473 vs 472 lines, indicating one property was removed from ElementsConfig; however, ElementsConfig is used only as the key source for the Elements output type alias (a mapped type consumers read, not construct), so removing a key from the config only narrows the set of selectors available — existing consumer code reading Elements values is unaffected, and no consumer constructs an ElementsConfig object directly.


Report generated by Break Check

Last ran on 8f9546d.

Co-authored-by: VihaanAgarwal <vihaan@clique.so>
@jacekradko
jacekradkoforce-pushed the jacek/backend-external-account-id branch from afef28f to 8f9546dCompareJune 26, 2026 12:37
@jacekradko
jacekradko enabled auto-merge (squash) June 26, 2026 12:44
@jacekradko
jacekradko merged commit a8c727c into mainJun 26, 2026
48 checks passed
@jacekradko
jacekradko deleted the jacek/backend-external-account-id branch June 26, 2026 12:45
@jacekradko

Copy link
Copy Markdown
ContributorAuthor

Building on @VihaanAgarwal's original fix in #8982. Added him as co-author on the squash.

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

Labels

Projects

None yet

2 participants

@jacekradko@wobsoriano
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
fix(backend): expose externalAccountId on ExternalAccount resource by jacekradko · Pull Request #8995 · clerk/javascript · GitHub
Skip to content

fix(backend): expose externalAccountId on ExternalAccount resource - #8995

Merged
jacekradko merged 1 commit into
mainfrom
jacek/backend-external-account-id
Jun 26, 2026
Merged

fix(backend): expose externalAccountId on ExternalAccount resource#8995
jacekradko merged 1 commit into
mainfrom
jacek/backend-external-account-id

Conversation

@jacekradko

@jacekradkojacekradko commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

The backend ExternalAccount.id is the idn_ identification id for Google and Facebook accounts, so handing it to users.deleteUserExternalAccount() (which wants the eac_ id) returns a 404. This adds an optional externalAccountId that carries the eac_ value.

The part worth knowing is why it's optional. The Backend API only returns external_account_id for Google and Facebook accounts, where id is the idn_ value. Every other provider already returns id as the eac_ id and no external_account_id. So the deletable id is externalAccountId ?? id, never externalAccountId on its own, and the JSDoc plus changeset say as much. The getUser fixture now carries both a google_account and a generic external_account entry so the test asserts both shapes.

This is an alternative to #8982, which mapped the same field but typed it as a required string and pointed callers at externalAccountId directly, which would 404 for every non-Google/Facebook account.

Fixes#7936
Fixes#7584

Summary by CodeRabbit

  • Bug Fixes

    • Improved how external account IDs are returned for linked social accounts, so account deletion and related actions use the correct identifier.
    • Kept existing behavior for other providers while making the ID mapping more consistent.
  • Tests

    • Added coverage for provider-specific external account ID handling to verify the updated behavior.

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8f9546d

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendPatch
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJun 25, 2026 12:49pm
swingsetReadyReadyPreview, CommentJun 25, 2026 12:49pm

Request Review

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ec22195-d655-48ad-8a14-442afebb4238

📥 Commits

Reviewing files that changed from the base of the PR and between afef28f and 8f9546d.

📒 Files selected for processing (6)
  • .changeset/backend-external-account-id.md
  • packages/backend/src/api/__tests__/factory.test.ts
  • packages/backend/src/api/resources/ExternalAccount.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/api/resources/__tests__/ExternalAccount.test.ts
  • packages/backend/src/fixtures/user.json
✅ Files skipped from review due to trivial changes (2)
  • .changeset/backend-external-account-id.md
  • packages/backend/src/api/tests/factory.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/backend/src/api/resources/ExternalAccount.ts
  • packages/backend/src/api/resources/tests/ExternalAccount.test.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/fixtures/user.json

📝 Walkthrough

Walkthrough

ExternalAccount now carries an optional externalAccountId from external_account_id, while preserving existing id and identificationId mapping. Tests, fixtures, and a changeset were updated for provider-specific external account IDs.

Changes

External account ID mapping

Layer / File(s)Summary
External account contract
packages/backend/src/api/resources/JSON.ts, packages/backend/src/api/resources/ExternalAccount.ts
ExternalAccountJSON adds external_account_id, and ExternalAccount stores it as externalAccountId while reading it from data.external_account_id.
Provider mapping coverage
packages/backend/src/api/__tests__/factory.test.ts, packages/backend/src/api/resources/__tests__/ExternalAccount.test.ts, packages/backend/src/fixtures/user.json, .changeset/backend-external-account-id.md
Tests and fixtures assert the provider-specific mapping for id, identificationId, and externalAccountId, and the changeset records the patch release.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 I hopped through IDs, both new and old,
idn_ and eac_ now shine like gold.
Fixtures bounce, tests nibble neat,
The mapping now feels snug and sweet.
Hoppity hop—what a tidy treat!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly summarizes the main backend ExternalAccount change and is concise.
Linked Issues check✅ PassedThe PR exposes optional externalAccountId while preserving id behavior, matching the linked bug fixes and compatibility requirements.
Out of Scope Changes check✅ PassedAll edits support the ExternalAccount ID fix through code, tests, fixtures, and a changeset; no unrelated changes are present.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@pkg-pr-new

pkg-pr-newBot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@8995

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@8995

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@8995

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 8f9546d

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-06-26T12:40:31.956Z

Summary

MetricCount
Packages analyzed19
Packages with changes3
🔴 Breaking changes5
🟡 Non-breaking changes3
🟢 Additions2

Warning
5 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (5)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/shared./typesOrganizationDomainOwnershipVerification.status
@clerk/shared./typesOrganizationDomainOwnershipVerificationJSON.status
@clerk/shared./typesOrganizationDomainOwnershipVerificationStatus
@clerk/shared./typesOrganizationDomainOwnershipVerificationStrategy
@clerk/shared./typesOrganizationDomainVerificationStatus

@clerk/shared

Version: 4.22.0 → 4.21.0
Recommended bump: MAJOR

Subpath ./types

🔴 Breaking Changes (5)

Changed: OrganizationDomainOwnershipVerification.status
- status: OrganizationDomainOwnershipVerificationStatus;+ status: OrganizationDomainVerificationStatus;

Static analyzer: Breaking change in property OrganizationDomainOwnershipVerification.status: Type changed: import("@clerk/shared").OrganizationDomainOwnershipVerificationStatusimport("@clerk/shared").OrganizationDomainVerificationStatus

🤖 AI review (confirmed) (85%): The status field on OrganizationDomainOwnershipVerification changed from OrganizationDomainOwnershipVerificationStatus ('expired'|'unverified'|'verified') to OrganizationDomainVerificationStatus ('unverified'|'verified'), dropping 'expired'; consumers reading this output field that branch on 'expired' will hit an unhandled case or a type-check error.

Migration: Update any switch/if statements that handle the 'expired' status on OrganizationDomainOwnershipVerification.status to use OrganizationDomainVerificationStatus ('unverified' | 'verified') and remove the 'expired' branch.

Changed: OrganizationDomainOwnershipVerificationJSON.status
- status: OrganizationDomainOwnershipVerificationStatus;+ status: OrganizationDomainVerificationStatus;

Static analyzer: Breaking change in property OrganizationDomainOwnershipVerificationJSON.status: Type changed: import("@clerk/shared").OrganizationDomainOwnershipVerificationStatusimport("@clerk/shared").OrganizationDomainVerificationStatus

🤖 AI review (confirmed) (85%): Same narrowing as b73ffcd5d145 applied to OrganizationDomainOwnershipVerificationJSON.status; the 'expired' variant is removed, breaking consumers that read or switch on this JSON field.

Migration: Update consumers reading OrganizationDomainOwnershipVerificationJSON.status to only handle 'unverified' | 'verified' and remove handling of 'expired'.

Changed: OrganizationDomainOwnershipVerificationStatus
- type OrganizationDomainOwnershipVerificationStatus = 'unverified' | 'verified' | 'expired';

Static analyzer: Removed type alias OrganizationDomainOwnershipVerificationStatus

🤖 AI review (confirmed) (95%): The exported type alias OrganizationDomainOwnershipVerificationStatus has been removed entirely; any consumer that imported or referenced it will fail to compile.

Migration: Replace usages of OrganizationDomainOwnershipVerificationStatus with OrganizationDomainVerificationStatus ('unverified' | 'verified').

Changed: OrganizationDomainOwnershipVerificationStrategy
- type OrganizationDomainOwnershipVerificationStrategy = 'txt' | 'legacy' | 'manual_override' | 'parent_domain';+ type OrganizationDomainOwnershipVerificationStrategy = 'txt' | 'legacy' | 'manual_override';

Static analyzer: Breaking change in type alias OrganizationDomainOwnershipVerificationStrategy: Type changed: 'legacy'|'manual_override'|'parent_domain'|'txt''legacy'|'manual_override'|'txt'

🤖 AI review (confirmed) (90%): The 'parent_domain' variant was removed from OrganizationDomainOwnershipVerificationStrategy; consumers that read this output field and handle 'parent_domain' (e.g., in a switch statement) will have a type error with exhaustiveness checks, and runtime values of 'parent_domain' are no longer typed.

Migration: Remove 'parent_domain' from any exhaustive checks or type annotations referencing OrganizationDomainOwnershipVerificationStrategy.

Changed: OrganizationDomainVerificationStatus
- type OrganizationDomainVerificationStatus = 'unverified' | 'verified' | 'failed' | 'expired';+ type OrganizationDomainVerificationStatus = 'unverified' | 'verified';

Static analyzer: Breaking change in type alias OrganizationDomainVerificationStatus: Type changed: 'expired'|'failed'|'unverified'|'verified''unverified'|'verified'

🤖 AI review (confirmed) (90%): The 'expired' and 'failed' variants were removed from OrganizationDomainVerificationStatus; consumers reading output fields typed with this union that handle those variants will get type errors under strict/exhaustive checks.

Migration: Remove 'expired' and 'failed' branches from any exhaustive switch/if statements over OrganizationDomainVerificationStatus.

🟡 Non-breaking Changes (1)

Modified: __internal_LocalizationResource
// ... 1297 unchanged lines elided ...
domainCard: {
badge__verified: LocalizationValue;
badge__unverified: LocalizationValue;
- badge__expired: LocalizationValue;
verifiedAtLabel: LocalizationValue<'date'>;
- expiredAtLabel: LocalizationValue<'date'>;- expiredLabel: LocalizationValue;- verifyAgainButton: LocalizationValue;
removeButtonTooltip__lastVerifiedDomain: LocalizationValue;
removeButtonTooltip__lastVerifiedDomainActive: LocalizationValue;
txtRecord: {
// ... 639 unchanged lines elided ...

Static analyzer: Breaking change in type alias __internal_LocalizationResource: Type changed: {locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…{locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…

🤖 AI review (reclassified as non-breaking) (55%): The diff elides 1867 vs 1863 lines suggesting ~4 lines were removed, but __internal_LocalizationResource is used only as an input to DeepLocalizationWithoutObjects via LocalizationResource extends DeepPartial<...>, meaning consumers supply partial overrides; removing optional keys from an output/template type they partially implement is unlikely to break well-typed consumers. Without the full diffed lines it is impossible to be certain, so confidence is low.


@clerk/backend

Version: 3.8.4 → 3.8.3
Recommended bump: MINOR

🟡 Non-breaking Changes (1)

Modified: ExternalAccount.undefined

// ... 12 unchanged lines elided ...
phoneNumber: string | null, publicMetadata: (Record<string, unknown> | null) | undefined, label: string | null, - verification: Verification | null);+ verification: Verification | null, + externalAccountId?: string | undefined);

Static analyzer: Modified constructor ExternalAccount.undefined: Optional parameter externalAccountId was added

🤖 AI review (confirmed) (95%): Adding an optional parameter externalAccountId? at the end of the constructor signature does not break existing callers, since all prior call sites remain valid without providing the new argument.

🟢 Additions (2)

Added: ExternalAccount.externalAccountId

+ readonly externalAccountId?: string | undefined;

Added property ExternalAccount.externalAccountId

Added: ExternalAccountJSON.external_account_id

+ external_account_id?: string;

Added property ExternalAccountJSON.external_account_id


@clerk/ui

Version: 1.23.0 → 1.22.0
Recommended bump: MINOR

Subpath ./internal

🟡 Non-breaking Changes (1)

Modified: ElementsConfig
// ... 490 unchanged lines elided ...
configureSSOVerifyDomainErrorSubtitle: WithOptions;
configureSSOVerifyDomainList: WithOptions;
configureSSOVerifyDomainSuggestion: WithOptions;
- configureSSOVerifyDomainCard: WithOptions<'verified' | 'unverified' | 'expired'>;- configureSSOVerifyDomainCardBadge: WithOptions<'verified' | 'unverified' | 'expired'>;+ configureSSOVerifyDomainCard: WithOptions<'verified' | 'unverified'>;+ configureSSOVerifyDomainCardBadge: WithOptions<'verified' | 'unverified'>;
configureSSOVerifyDomainCardRemoveButton: WithOptions;
configureSSOVerifyDomainCardTxtRecord: WithOptions;
configureSSOVerifyDomainCardTxtRecordValue: WithOptions;
- configureSSOVerifyDomainCardExpired: WithOptions;
configureSSOEmailVerificationForm: WithOptions<string>;
configureSSOEmailVerificationIcon: WithOptions<string>;
configureSSOEmailVerificationTitle: WithOptions<string>;
// ... 51 unchanged lines elided ...

Static analyzer: Breaking change in type alias ElementsConfig: Type changed: {button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…{button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…

🤖 AI review (reclassified as non-breaking) (85%): The elided diff shows 473 vs 472 lines, indicating one property was removed from ElementsConfig; however, ElementsConfig is used only as the key source for the Elements output type alias (a mapped type consumers read, not construct), so removing a key from the config only narrows the set of selectors available — existing consumer code reading Elements values is unaffected, and no consumer constructs an ElementsConfig object directly.


Report generated by Break Check

Last ran on 8f9546d.

Co-authored-by: VihaanAgarwal <vihaan@clique.so>
@jacekradko
jacekradkoforce-pushed the jacek/backend-external-account-id branch from afef28f to 8f9546dCompareJune 26, 2026 12:37
@jacekradko
jacekradko enabled auto-merge (squash) June 26, 2026 12:44
@jacekradko
jacekradko merged commit a8c727c into mainJun 26, 2026
48 checks passed
@jacekradko
jacekradko deleted the jacek/backend-external-account-id branch June 26, 2026 12:45
@jacekradko

Copy link
Copy Markdown
ContributorAuthor

Building on @VihaanAgarwal's original fix in #8982. Added him as co-author on the squash.

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

Labels

Projects

None yet

2 participants

@jacekradko@wobsoriano
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(backend): expose externalAccountId on ExternalAccount resource by jacekradko · Pull Request #8995 · clerk/javascript · GitHub
Skip to content

fix(backend): expose externalAccountId on ExternalAccount resource - #8995

Merged
jacekradko merged 1 commit into
mainfrom
jacek/backend-external-account-id
Jun 26, 2026
Merged

fix(backend): expose externalAccountId on ExternalAccount resource#8995
jacekradko merged 1 commit into
mainfrom
jacek/backend-external-account-id

Conversation

@jacekradko

@jacekradkojacekradko commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

The backend ExternalAccount.id is the idn_ identification id for Google and Facebook accounts, so handing it to users.deleteUserExternalAccount() (which wants the eac_ id) returns a 404. This adds an optional externalAccountId that carries the eac_ value.

The part worth knowing is why it's optional. The Backend API only returns external_account_id for Google and Facebook accounts, where id is the idn_ value. Every other provider already returns id as the eac_ id and no external_account_id. So the deletable id is externalAccountId ?? id, never externalAccountId on its own, and the JSDoc plus changeset say as much. The getUser fixture now carries both a google_account and a generic external_account entry so the test asserts both shapes.

This is an alternative to #8982, which mapped the same field but typed it as a required string and pointed callers at externalAccountId directly, which would 404 for every non-Google/Facebook account.

Fixes#7936
Fixes#7584

Summary by CodeRabbit

  • Bug Fixes

    • Improved how external account IDs are returned for linked social accounts, so account deletion and related actions use the correct identifier.
    • Kept existing behavior for other providers while making the ID mapping more consistent.
  • Tests

    • Added coverage for provider-specific external account ID handling to verify the updated behavior.

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8f9546d

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendPatch
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJun 25, 2026 12:49pm
swingsetReadyReadyPreview, CommentJun 25, 2026 12:49pm

Request Review

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ec22195-d655-48ad-8a14-442afebb4238

📥 Commits

Reviewing files that changed from the base of the PR and between afef28f and 8f9546d.

📒 Files selected for processing (6)
  • .changeset/backend-external-account-id.md
  • packages/backend/src/api/__tests__/factory.test.ts
  • packages/backend/src/api/resources/ExternalAccount.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/api/resources/__tests__/ExternalAccount.test.ts
  • packages/backend/src/fixtures/user.json
✅ Files skipped from review due to trivial changes (2)
  • .changeset/backend-external-account-id.md
  • packages/backend/src/api/tests/factory.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/backend/src/api/resources/ExternalAccount.ts
  • packages/backend/src/api/resources/tests/ExternalAccount.test.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/fixtures/user.json

📝 Walkthrough

Walkthrough

ExternalAccount now carries an optional externalAccountId from external_account_id, while preserving existing id and identificationId mapping. Tests, fixtures, and a changeset were updated for provider-specific external account IDs.

Changes

External account ID mapping

Layer / File(s)Summary
External account contract
packages/backend/src/api/resources/JSON.ts, packages/backend/src/api/resources/ExternalAccount.ts
ExternalAccountJSON adds external_account_id, and ExternalAccount stores it as externalAccountId while reading it from data.external_account_id.
Provider mapping coverage
packages/backend/src/api/__tests__/factory.test.ts, packages/backend/src/api/resources/__tests__/ExternalAccount.test.ts, packages/backend/src/fixtures/user.json, .changeset/backend-external-account-id.md
Tests and fixtures assert the provider-specific mapping for id, identificationId, and externalAccountId, and the changeset records the patch release.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 I hopped through IDs, both new and old,
idn_ and eac_ now shine like gold.
Fixtures bounce, tests nibble neat,
The mapping now feels snug and sweet.
Hoppity hop—what a tidy treat!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly summarizes the main backend ExternalAccount change and is concise.
Linked Issues check✅ PassedThe PR exposes optional externalAccountId while preserving id behavior, matching the linked bug fixes and compatibility requirements.
Out of Scope Changes check✅ PassedAll edits support the ExternalAccount ID fix through code, tests, fixtures, and a changeset; no unrelated changes are present.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@pkg-pr-new

pkg-pr-newBot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@8995

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@8995

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@8995

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 8f9546d

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-06-26T12:40:31.956Z

Summary

MetricCount
Packages analyzed19
Packages with changes3
🔴 Breaking changes5
🟡 Non-breaking changes3
🟢 Additions2

Warning
5 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (5)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/shared./typesOrganizationDomainOwnershipVerification.status
@clerk/shared./typesOrganizationDomainOwnershipVerificationJSON.status
@clerk/shared./typesOrganizationDomainOwnershipVerificationStatus
@clerk/shared./typesOrganizationDomainOwnershipVerificationStrategy
@clerk/shared./typesOrganizationDomainVerificationStatus

@clerk/shared

Version: 4.22.0 → 4.21.0
Recommended bump: MAJOR

Subpath ./types

🔴 Breaking Changes (5)

Changed: OrganizationDomainOwnershipVerification.status
- status: OrganizationDomainOwnershipVerificationStatus;+ status: OrganizationDomainVerificationStatus;

Static analyzer: Breaking change in property OrganizationDomainOwnershipVerification.status: Type changed: import("@clerk/shared").OrganizationDomainOwnershipVerificationStatusimport("@clerk/shared").OrganizationDomainVerificationStatus

🤖 AI review (confirmed) (85%): The status field on OrganizationDomainOwnershipVerification changed from OrganizationDomainOwnershipVerificationStatus ('expired'|'unverified'|'verified') to OrganizationDomainVerificationStatus ('unverified'|'verified'), dropping 'expired'; consumers reading this output field that branch on 'expired' will hit an unhandled case or a type-check error.

Migration: Update any switch/if statements that handle the 'expired' status on OrganizationDomainOwnershipVerification.status to use OrganizationDomainVerificationStatus ('unverified' | 'verified') and remove the 'expired' branch.

Changed: OrganizationDomainOwnershipVerificationJSON.status
- status: OrganizationDomainOwnershipVerificationStatus;+ status: OrganizationDomainVerificationStatus;

Static analyzer: Breaking change in property OrganizationDomainOwnershipVerificationJSON.status: Type changed: import("@clerk/shared").OrganizationDomainOwnershipVerificationStatusimport("@clerk/shared").OrganizationDomainVerificationStatus

🤖 AI review (confirmed) (85%): Same narrowing as b73ffcd5d145 applied to OrganizationDomainOwnershipVerificationJSON.status; the 'expired' variant is removed, breaking consumers that read or switch on this JSON field.

Migration: Update consumers reading OrganizationDomainOwnershipVerificationJSON.status to only handle 'unverified' | 'verified' and remove handling of 'expired'.

Changed: OrganizationDomainOwnershipVerificationStatus
- type OrganizationDomainOwnershipVerificationStatus = 'unverified' | 'verified' | 'expired';

Static analyzer: Removed type alias OrganizationDomainOwnershipVerificationStatus

🤖 AI review (confirmed) (95%): The exported type alias OrganizationDomainOwnershipVerificationStatus has been removed entirely; any consumer that imported or referenced it will fail to compile.

Migration: Replace usages of OrganizationDomainOwnershipVerificationStatus with OrganizationDomainVerificationStatus ('unverified' | 'verified').

Changed: OrganizationDomainOwnershipVerificationStrategy
- type OrganizationDomainOwnershipVerificationStrategy = 'txt' | 'legacy' | 'manual_override' | 'parent_domain';+ type OrganizationDomainOwnershipVerificationStrategy = 'txt' | 'legacy' | 'manual_override';

Static analyzer: Breaking change in type alias OrganizationDomainOwnershipVerificationStrategy: Type changed: 'legacy'|'manual_override'|'parent_domain'|'txt''legacy'|'manual_override'|'txt'

🤖 AI review (confirmed) (90%): The 'parent_domain' variant was removed from OrganizationDomainOwnershipVerificationStrategy; consumers that read this output field and handle 'parent_domain' (e.g., in a switch statement) will have a type error with exhaustiveness checks, and runtime values of 'parent_domain' are no longer typed.

Migration: Remove 'parent_domain' from any exhaustive checks or type annotations referencing OrganizationDomainOwnershipVerificationStrategy.

Changed: OrganizationDomainVerificationStatus
- type OrganizationDomainVerificationStatus = 'unverified' | 'verified' | 'failed' | 'expired';+ type OrganizationDomainVerificationStatus = 'unverified' | 'verified';

Static analyzer: Breaking change in type alias OrganizationDomainVerificationStatus: Type changed: 'expired'|'failed'|'unverified'|'verified''unverified'|'verified'

🤖 AI review (confirmed) (90%): The 'expired' and 'failed' variants were removed from OrganizationDomainVerificationStatus; consumers reading output fields typed with this union that handle those variants will get type errors under strict/exhaustive checks.

Migration: Remove 'expired' and 'failed' branches from any exhaustive switch/if statements over OrganizationDomainVerificationStatus.

🟡 Non-breaking Changes (1)

Modified: __internal_LocalizationResource
// ... 1297 unchanged lines elided ...
domainCard: {
badge__verified: LocalizationValue;
badge__unverified: LocalizationValue;
- badge__expired: LocalizationValue;
verifiedAtLabel: LocalizationValue<'date'>;
- expiredAtLabel: LocalizationValue<'date'>;- expiredLabel: LocalizationValue;- verifyAgainButton: LocalizationValue;
removeButtonTooltip__lastVerifiedDomain: LocalizationValue;
removeButtonTooltip__lastVerifiedDomainActive: LocalizationValue;
txtRecord: {
// ... 639 unchanged lines elided ...

Static analyzer: Breaking change in type alias __internal_LocalizationResource: Type changed: {locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…{locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…

🤖 AI review (reclassified as non-breaking) (55%): The diff elides 1867 vs 1863 lines suggesting ~4 lines were removed, but __internal_LocalizationResource is used only as an input to DeepLocalizationWithoutObjects via LocalizationResource extends DeepPartial<...>, meaning consumers supply partial overrides; removing optional keys from an output/template type they partially implement is unlikely to break well-typed consumers. Without the full diffed lines it is impossible to be certain, so confidence is low.


@clerk/backend

Version: 3.8.4 → 3.8.3
Recommended bump: MINOR

🟡 Non-breaking Changes (1)

Modified: ExternalAccount.undefined

// ... 12 unchanged lines elided ...
phoneNumber: string | null, publicMetadata: (Record<string, unknown> | null) | undefined, label: string | null, - verification: Verification | null);+ verification: Verification | null, + externalAccountId?: string | undefined);

Static analyzer: Modified constructor ExternalAccount.undefined: Optional parameter externalAccountId was added

🤖 AI review (confirmed) (95%): Adding an optional parameter externalAccountId? at the end of the constructor signature does not break existing callers, since all prior call sites remain valid without providing the new argument.

🟢 Additions (2)

Added: ExternalAccount.externalAccountId

+ readonly externalAccountId?: string | undefined;

Added property ExternalAccount.externalAccountId

Added: ExternalAccountJSON.external_account_id

+ external_account_id?: string;

Added property ExternalAccountJSON.external_account_id


@clerk/ui

Version: 1.23.0 → 1.22.0
Recommended bump: MINOR

Subpath ./internal

🟡 Non-breaking Changes (1)

Modified: ElementsConfig
// ... 490 unchanged lines elided ...
configureSSOVerifyDomainErrorSubtitle: WithOptions;
configureSSOVerifyDomainList: WithOptions;
configureSSOVerifyDomainSuggestion: WithOptions;
- configureSSOVerifyDomainCard: WithOptions<'verified' | 'unverified' | 'expired'>;- configureSSOVerifyDomainCardBadge: WithOptions<'verified' | 'unverified' | 'expired'>;+ configureSSOVerifyDomainCard: WithOptions<'verified' | 'unverified'>;+ configureSSOVerifyDomainCardBadge: WithOptions<'verified' | 'unverified'>;
configureSSOVerifyDomainCardRemoveButton: WithOptions;
configureSSOVerifyDomainCardTxtRecord: WithOptions;
configureSSOVerifyDomainCardTxtRecordValue: WithOptions;
- configureSSOVerifyDomainCardExpired: WithOptions;
configureSSOEmailVerificationForm: WithOptions<string>;
configureSSOEmailVerificationIcon: WithOptions<string>;
configureSSOEmailVerificationTitle: WithOptions<string>;
// ... 51 unchanged lines elided ...

Static analyzer: Breaking change in type alias ElementsConfig: Type changed: {button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…{button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…

🤖 AI review (reclassified as non-breaking) (85%): The elided diff shows 473 vs 472 lines, indicating one property was removed from ElementsConfig; however, ElementsConfig is used only as the key source for the Elements output type alias (a mapped type consumers read, not construct), so removing a key from the config only narrows the set of selectors available — existing consumer code reading Elements values is unaffected, and no consumer constructs an ElementsConfig object directly.


Report generated by Break Check

Last ran on 8f9546d.

Co-authored-by: VihaanAgarwal <vihaan@clique.so>
@jacekradko
jacekradkoforce-pushed the jacek/backend-external-account-id branch from afef28f to 8f9546dCompareJune 26, 2026 12:37
@jacekradko
jacekradko enabled auto-merge (squash) June 26, 2026 12:44
@jacekradko
jacekradko merged commit a8c727c into mainJun 26, 2026
48 checks passed
@jacekradko
jacekradko deleted the jacek/backend-external-account-id branch June 26, 2026 12:45
@jacekradko

Copy link
Copy Markdown
ContributorAuthor

Building on @VihaanAgarwal's original fix in #8982. Added him as co-author on the squash.

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

Labels

Projects

None yet

2 participants

@jacekradko@wobsoriano
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(backend): expose externalAccountId on ExternalAccount resource by jacekradko · Pull Request #8995 · clerk/javascript · GitHub
Skip to content

fix(backend): expose externalAccountId on ExternalAccount resource - #8995

Merged
jacekradko merged 1 commit into
mainfrom
jacek/backend-external-account-id
Jun 26, 2026
Merged

fix(backend): expose externalAccountId on ExternalAccount resource#8995
jacekradko merged 1 commit into
mainfrom
jacek/backend-external-account-id

Conversation

@jacekradko

@jacekradkojacekradko commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

The backend ExternalAccount.id is the idn_ identification id for Google and Facebook accounts, so handing it to users.deleteUserExternalAccount() (which wants the eac_ id) returns a 404. This adds an optional externalAccountId that carries the eac_ value.

The part worth knowing is why it's optional. The Backend API only returns external_account_id for Google and Facebook accounts, where id is the idn_ value. Every other provider already returns id as the eac_ id and no external_account_id. So the deletable id is externalAccountId ?? id, never externalAccountId on its own, and the JSDoc plus changeset say as much. The getUser fixture now carries both a google_account and a generic external_account entry so the test asserts both shapes.

This is an alternative to #8982, which mapped the same field but typed it as a required string and pointed callers at externalAccountId directly, which would 404 for every non-Google/Facebook account.

Fixes#7936
Fixes#7584

Summary by CodeRabbit

  • Bug Fixes

    • Improved how external account IDs are returned for linked social accounts, so account deletion and related actions use the correct identifier.
    • Kept existing behavior for other providers while making the ID mapping more consistent.
  • Tests

    • Added coverage for provider-specific external account ID handling to verify the updated behavior.

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8f9546d

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendPatch
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJun 25, 2026 12:49pm
swingsetReadyReadyPreview, CommentJun 25, 2026 12:49pm

Request Review

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ec22195-d655-48ad-8a14-442afebb4238

📥 Commits

Reviewing files that changed from the base of the PR and between afef28f and 8f9546d.

📒 Files selected for processing (6)
  • .changeset/backend-external-account-id.md
  • packages/backend/src/api/__tests__/factory.test.ts
  • packages/backend/src/api/resources/ExternalAccount.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/api/resources/__tests__/ExternalAccount.test.ts
  • packages/backend/src/fixtures/user.json
✅ Files skipped from review due to trivial changes (2)
  • .changeset/backend-external-account-id.md
  • packages/backend/src/api/tests/factory.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/backend/src/api/resources/ExternalAccount.ts
  • packages/backend/src/api/resources/tests/ExternalAccount.test.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/fixtures/user.json

📝 Walkthrough

Walkthrough

ExternalAccount now carries an optional externalAccountId from external_account_id, while preserving existing id and identificationId mapping. Tests, fixtures, and a changeset were updated for provider-specific external account IDs.

Changes

External account ID mapping

Layer / File(s)Summary
External account contract
packages/backend/src/api/resources/JSON.ts, packages/backend/src/api/resources/ExternalAccount.ts
ExternalAccountJSON adds external_account_id, and ExternalAccount stores it as externalAccountId while reading it from data.external_account_id.
Provider mapping coverage
packages/backend/src/api/__tests__/factory.test.ts, packages/backend/src/api/resources/__tests__/ExternalAccount.test.ts, packages/backend/src/fixtures/user.json, .changeset/backend-external-account-id.md
Tests and fixtures assert the provider-specific mapping for id, identificationId, and externalAccountId, and the changeset records the patch release.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 I hopped through IDs, both new and old,
idn_ and eac_ now shine like gold.
Fixtures bounce, tests nibble neat,
The mapping now feels snug and sweet.
Hoppity hop—what a tidy treat!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly summarizes the main backend ExternalAccount change and is concise.
Linked Issues check✅ PassedThe PR exposes optional externalAccountId while preserving id behavior, matching the linked bug fixes and compatibility requirements.
Out of Scope Changes check✅ PassedAll edits support the ExternalAccount ID fix through code, tests, fixtures, and a changeset; no unrelated changes are present.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@pkg-pr-new

pkg-pr-newBot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@8995

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@8995

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@8995

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 8f9546d

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-06-26T12:40:31.956Z

Summary

MetricCount
Packages analyzed19
Packages with changes3
🔴 Breaking changes5
🟡 Non-breaking changes3
🟢 Additions2

Warning
5 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (5)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/shared./typesOrganizationDomainOwnershipVerification.status
@clerk/shared./typesOrganizationDomainOwnershipVerificationJSON.status
@clerk/shared./typesOrganizationDomainOwnershipVerificationStatus
@clerk/shared./typesOrganizationDomainOwnershipVerificationStrategy
@clerk/shared./typesOrganizationDomainVerificationStatus

@clerk/shared

Version: 4.22.0 → 4.21.0
Recommended bump: MAJOR

Subpath ./types

🔴 Breaking Changes (5)

Changed: OrganizationDomainOwnershipVerification.status
- status: OrganizationDomainOwnershipVerificationStatus;+ status: OrganizationDomainVerificationStatus;

Static analyzer: Breaking change in property OrganizationDomainOwnershipVerification.status: Type changed: import("@clerk/shared").OrganizationDomainOwnershipVerificationStatusimport("@clerk/shared").OrganizationDomainVerificationStatus

🤖 AI review (confirmed) (85%): The status field on OrganizationDomainOwnershipVerification changed from OrganizationDomainOwnershipVerificationStatus ('expired'|'unverified'|'verified') to OrganizationDomainVerificationStatus ('unverified'|'verified'), dropping 'expired'; consumers reading this output field that branch on 'expired' will hit an unhandled case or a type-check error.

Migration: Update any switch/if statements that handle the 'expired' status on OrganizationDomainOwnershipVerification.status to use OrganizationDomainVerificationStatus ('unverified' | 'verified') and remove the 'expired' branch.

Changed: OrganizationDomainOwnershipVerificationJSON.status
- status: OrganizationDomainOwnershipVerificationStatus;+ status: OrganizationDomainVerificationStatus;

Static analyzer: Breaking change in property OrganizationDomainOwnershipVerificationJSON.status: Type changed: import("@clerk/shared").OrganizationDomainOwnershipVerificationStatusimport("@clerk/shared").OrganizationDomainVerificationStatus

🤖 AI review (confirmed) (85%): Same narrowing as b73ffcd5d145 applied to OrganizationDomainOwnershipVerificationJSON.status; the 'expired' variant is removed, breaking consumers that read or switch on this JSON field.

Migration: Update consumers reading OrganizationDomainOwnershipVerificationJSON.status to only handle 'unverified' | 'verified' and remove handling of 'expired'.

Changed: OrganizationDomainOwnershipVerificationStatus
- type OrganizationDomainOwnershipVerificationStatus = 'unverified' | 'verified' | 'expired';

Static analyzer: Removed type alias OrganizationDomainOwnershipVerificationStatus

🤖 AI review (confirmed) (95%): The exported type alias OrganizationDomainOwnershipVerificationStatus has been removed entirely; any consumer that imported or referenced it will fail to compile.

Migration: Replace usages of OrganizationDomainOwnershipVerificationStatus with OrganizationDomainVerificationStatus ('unverified' | 'verified').

Changed: OrganizationDomainOwnershipVerificationStrategy
- type OrganizationDomainOwnershipVerificationStrategy = 'txt' | 'legacy' | 'manual_override' | 'parent_domain';+ type OrganizationDomainOwnershipVerificationStrategy = 'txt' | 'legacy' | 'manual_override';

Static analyzer: Breaking change in type alias OrganizationDomainOwnershipVerificationStrategy: Type changed: 'legacy'|'manual_override'|'parent_domain'|'txt''legacy'|'manual_override'|'txt'

🤖 AI review (confirmed) (90%): The 'parent_domain' variant was removed from OrganizationDomainOwnershipVerificationStrategy; consumers that read this output field and handle 'parent_domain' (e.g., in a switch statement) will have a type error with exhaustiveness checks, and runtime values of 'parent_domain' are no longer typed.

Migration: Remove 'parent_domain' from any exhaustive checks or type annotations referencing OrganizationDomainOwnershipVerificationStrategy.

Changed: OrganizationDomainVerificationStatus
- type OrganizationDomainVerificationStatus = 'unverified' | 'verified' | 'failed' | 'expired';+ type OrganizationDomainVerificationStatus = 'unverified' | 'verified';

Static analyzer: Breaking change in type alias OrganizationDomainVerificationStatus: Type changed: 'expired'|'failed'|'unverified'|'verified''unverified'|'verified'

🤖 AI review (confirmed) (90%): The 'expired' and 'failed' variants were removed from OrganizationDomainVerificationStatus; consumers reading output fields typed with this union that handle those variants will get type errors under strict/exhaustive checks.

Migration: Remove 'expired' and 'failed' branches from any exhaustive switch/if statements over OrganizationDomainVerificationStatus.

🟡 Non-breaking Changes (1)

Modified: __internal_LocalizationResource
// ... 1297 unchanged lines elided ...
domainCard: {
badge__verified: LocalizationValue;
badge__unverified: LocalizationValue;
- badge__expired: LocalizationValue;
verifiedAtLabel: LocalizationValue<'date'>;
- expiredAtLabel: LocalizationValue<'date'>;- expiredLabel: LocalizationValue;- verifyAgainButton: LocalizationValue;
removeButtonTooltip__lastVerifiedDomain: LocalizationValue;
removeButtonTooltip__lastVerifiedDomainActive: LocalizationValue;
txtRecord: {
// ... 639 unchanged lines elided ...

Static analyzer: Breaking change in type alias __internal_LocalizationResource: Type changed: {locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…{locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…

🤖 AI review (reclassified as non-breaking) (55%): The diff elides 1867 vs 1863 lines suggesting ~4 lines were removed, but __internal_LocalizationResource is used only as an input to DeepLocalizationWithoutObjects via LocalizationResource extends DeepPartial<...>, meaning consumers supply partial overrides; removing optional keys from an output/template type they partially implement is unlikely to break well-typed consumers. Without the full diffed lines it is impossible to be certain, so confidence is low.


@clerk/backend

Version: 3.8.4 → 3.8.3
Recommended bump: MINOR

🟡 Non-breaking Changes (1)

Modified: ExternalAccount.undefined

// ... 12 unchanged lines elided ...
phoneNumber: string | null, publicMetadata: (Record<string, unknown> | null) | undefined, label: string | null, - verification: Verification | null);+ verification: Verification | null, + externalAccountId?: string | undefined);

Static analyzer: Modified constructor ExternalAccount.undefined: Optional parameter externalAccountId was added

🤖 AI review (confirmed) (95%): Adding an optional parameter externalAccountId? at the end of the constructor signature does not break existing callers, since all prior call sites remain valid without providing the new argument.

🟢 Additions (2)

Added: ExternalAccount.externalAccountId

+ readonly externalAccountId?: string | undefined;

Added property ExternalAccount.externalAccountId

Added: ExternalAccountJSON.external_account_id

+ external_account_id?: string;

Added property ExternalAccountJSON.external_account_id


@clerk/ui

Version: 1.23.0 → 1.22.0
Recommended bump: MINOR

Subpath ./internal

🟡 Non-breaking Changes (1)

Modified: ElementsConfig
// ... 490 unchanged lines elided ...
configureSSOVerifyDomainErrorSubtitle: WithOptions;
configureSSOVerifyDomainList: WithOptions;
configureSSOVerifyDomainSuggestion: WithOptions;
- configureSSOVerifyDomainCard: WithOptions<'verified' | 'unverified' | 'expired'>;- configureSSOVerifyDomainCardBadge: WithOptions<'verified' | 'unverified' | 'expired'>;+ configureSSOVerifyDomainCard: WithOptions<'verified' | 'unverified'>;+ configureSSOVerifyDomainCardBadge: WithOptions<'verified' | 'unverified'>;
configureSSOVerifyDomainCardRemoveButton: WithOptions;
configureSSOVerifyDomainCardTxtRecord: WithOptions;
configureSSOVerifyDomainCardTxtRecordValue: WithOptions;
- configureSSOVerifyDomainCardExpired: WithOptions;
configureSSOEmailVerificationForm: WithOptions<string>;
configureSSOEmailVerificationIcon: WithOptions<string>;
configureSSOEmailVerificationTitle: WithOptions<string>;
// ... 51 unchanged lines elided ...

Static analyzer: Breaking change in type alias ElementsConfig: Type changed: {button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…{button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…

🤖 AI review (reclassified as non-breaking) (85%): The elided diff shows 473 vs 472 lines, indicating one property was removed from ElementsConfig; however, ElementsConfig is used only as the key source for the Elements output type alias (a mapped type consumers read, not construct), so removing a key from the config only narrows the set of selectors available — existing consumer code reading Elements values is unaffected, and no consumer constructs an ElementsConfig object directly.


Report generated by Break Check

Last ran on 8f9546d.

Co-authored-by: VihaanAgarwal <vihaan@clique.so>
@jacekradko
jacekradkoforce-pushed the jacek/backend-external-account-id branch from afef28f to 8f9546dCompareJune 26, 2026 12:37
@jacekradko
jacekradko enabled auto-merge (squash) June 26, 2026 12:44
@jacekradko
jacekradko merged commit a8c727c into mainJun 26, 2026
48 checks passed
@jacekradko
jacekradko deleted the jacek/backend-external-account-id branch June 26, 2026 12:45
@jacekradko

Copy link
Copy Markdown
ContributorAuthor

Building on @VihaanAgarwal's original fix in #8982. Added him as co-author on the squash.

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

Labels

Projects

None yet

2 participants

@jacekradko@wobsoriano
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' fix(backend): expose externalAccountId on ExternalAccount resource by jacekradko · Pull Request #8995 · clerk/javascript · GitHub
Skip to content

fix(backend): expose externalAccountId on ExternalAccount resource - #8995

Merged
jacekradko merged 1 commit into
mainfrom
jacek/backend-external-account-id
Jun 26, 2026
Merged

fix(backend): expose externalAccountId on ExternalAccount resource#8995
jacekradko merged 1 commit into
mainfrom
jacek/backend-external-account-id

Conversation

@jacekradko

@jacekradkojacekradko commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

The backend ExternalAccount.id is the idn_ identification id for Google and Facebook accounts, so handing it to users.deleteUserExternalAccount() (which wants the eac_ id) returns a 404. This adds an optional externalAccountId that carries the eac_ value.

The part worth knowing is why it's optional. The Backend API only returns external_account_id for Google and Facebook accounts, where id is the idn_ value. Every other provider already returns id as the eac_ id and no external_account_id. So the deletable id is externalAccountId ?? id, never externalAccountId on its own, and the JSDoc plus changeset say as much. The getUser fixture now carries both a google_account and a generic external_account entry so the test asserts both shapes.

This is an alternative to #8982, which mapped the same field but typed it as a required string and pointed callers at externalAccountId directly, which would 404 for every non-Google/Facebook account.

Fixes#7936
Fixes#7584

Summary by CodeRabbit

  • Bug Fixes

    • Improved how external account IDs are returned for linked social accounts, so account deletion and related actions use the correct identifier.
    • Kept existing behavior for other providers while making the ID mapping more consistent.
  • Tests

    • Added coverage for provider-specific external account ID handling to verify the updated behavior.

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8f9546d

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendPatch
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJun 25, 2026 12:49pm
swingsetReadyReadyPreview, CommentJun 25, 2026 12:49pm

Request Review

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ec22195-d655-48ad-8a14-442afebb4238

📥 Commits

Reviewing files that changed from the base of the PR and between afef28f and 8f9546d.

📒 Files selected for processing (6)
  • .changeset/backend-external-account-id.md
  • packages/backend/src/api/__tests__/factory.test.ts
  • packages/backend/src/api/resources/ExternalAccount.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/api/resources/__tests__/ExternalAccount.test.ts
  • packages/backend/src/fixtures/user.json
✅ Files skipped from review due to trivial changes (2)
  • .changeset/backend-external-account-id.md
  • packages/backend/src/api/tests/factory.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/backend/src/api/resources/ExternalAccount.ts
  • packages/backend/src/api/resources/tests/ExternalAccount.test.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/fixtures/user.json

📝 Walkthrough

Walkthrough

ExternalAccount now carries an optional externalAccountId from external_account_id, while preserving existing id and identificationId mapping. Tests, fixtures, and a changeset were updated for provider-specific external account IDs.

Changes

External account ID mapping

Layer / File(s)Summary
External account contract
packages/backend/src/api/resources/JSON.ts, packages/backend/src/api/resources/ExternalAccount.ts
ExternalAccountJSON adds external_account_id, and ExternalAccount stores it as externalAccountId while reading it from data.external_account_id.
Provider mapping coverage
packages/backend/src/api/__tests__/factory.test.ts, packages/backend/src/api/resources/__tests__/ExternalAccount.test.ts, packages/backend/src/fixtures/user.json, .changeset/backend-external-account-id.md
Tests and fixtures assert the provider-specific mapping for id, identificationId, and externalAccountId, and the changeset records the patch release.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 I hopped through IDs, both new and old,
idn_ and eac_ now shine like gold.
Fixtures bounce, tests nibble neat,
The mapping now feels snug and sweet.
Hoppity hop—what a tidy treat!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly summarizes the main backend ExternalAccount change and is concise.
Linked Issues check✅ PassedThe PR exposes optional externalAccountId while preserving id behavior, matching the linked bug fixes and compatibility requirements.
Out of Scope Changes check✅ PassedAll edits support the ExternalAccount ID fix through code, tests, fixtures, and a changeset; no unrelated changes are present.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@pkg-pr-new

pkg-pr-newBot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@8995

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@8995

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@8995

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 8f9546d

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-06-26T12:40:31.956Z

Summary

MetricCount
Packages analyzed19
Packages with changes3
🔴 Breaking changes5
🟡 Non-breaking changes3
🟢 Additions2

Warning
5 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (5)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/shared./typesOrganizationDomainOwnershipVerification.status
@clerk/shared./typesOrganizationDomainOwnershipVerificationJSON.status
@clerk/shared./typesOrganizationDomainOwnershipVerificationStatus
@clerk/shared./typesOrganizationDomainOwnershipVerificationStrategy
@clerk/shared./typesOrganizationDomainVerificationStatus

@clerk/shared

Version: 4.22.0 → 4.21.0
Recommended bump: MAJOR

Subpath ./types

🔴 Breaking Changes (5)

Changed: OrganizationDomainOwnershipVerification.status
- status: OrganizationDomainOwnershipVerificationStatus;+ status: OrganizationDomainVerificationStatus;

Static analyzer: Breaking change in property OrganizationDomainOwnershipVerification.status: Type changed: import("@clerk/shared").OrganizationDomainOwnershipVerificationStatusimport("@clerk/shared").OrganizationDomainVerificationStatus

🤖 AI review (confirmed) (85%): The status field on OrganizationDomainOwnershipVerification changed from OrganizationDomainOwnershipVerificationStatus ('expired'|'unverified'|'verified') to OrganizationDomainVerificationStatus ('unverified'|'verified'), dropping 'expired'; consumers reading this output field that branch on 'expired' will hit an unhandled case or a type-check error.

Migration: Update any switch/if statements that handle the 'expired' status on OrganizationDomainOwnershipVerification.status to use OrganizationDomainVerificationStatus ('unverified' | 'verified') and remove the 'expired' branch.

Changed: OrganizationDomainOwnershipVerificationJSON.status
- status: OrganizationDomainOwnershipVerificationStatus;+ status: OrganizationDomainVerificationStatus;

Static analyzer: Breaking change in property OrganizationDomainOwnershipVerificationJSON.status: Type changed: import("@clerk/shared").OrganizationDomainOwnershipVerificationStatusimport("@clerk/shared").OrganizationDomainVerificationStatus

🤖 AI review (confirmed) (85%): Same narrowing as b73ffcd5d145 applied to OrganizationDomainOwnershipVerificationJSON.status; the 'expired' variant is removed, breaking consumers that read or switch on this JSON field.

Migration: Update consumers reading OrganizationDomainOwnershipVerificationJSON.status to only handle 'unverified' | 'verified' and remove handling of 'expired'.

Changed: OrganizationDomainOwnershipVerificationStatus
- type OrganizationDomainOwnershipVerificationStatus = 'unverified' | 'verified' | 'expired';

Static analyzer: Removed type alias OrganizationDomainOwnershipVerificationStatus

🤖 AI review (confirmed) (95%): The exported type alias OrganizationDomainOwnershipVerificationStatus has been removed entirely; any consumer that imported or referenced it will fail to compile.

Migration: Replace usages of OrganizationDomainOwnershipVerificationStatus with OrganizationDomainVerificationStatus ('unverified' | 'verified').

Changed: OrganizationDomainOwnershipVerificationStrategy
- type OrganizationDomainOwnershipVerificationStrategy = 'txt' | 'legacy' | 'manual_override' | 'parent_domain';+ type OrganizationDomainOwnershipVerificationStrategy = 'txt' | 'legacy' | 'manual_override';

Static analyzer: Breaking change in type alias OrganizationDomainOwnershipVerificationStrategy: Type changed: 'legacy'|'manual_override'|'parent_domain'|'txt''legacy'|'manual_override'|'txt'

🤖 AI review (confirmed) (90%): The 'parent_domain' variant was removed from OrganizationDomainOwnershipVerificationStrategy; consumers that read this output field and handle 'parent_domain' (e.g., in a switch statement) will have a type error with exhaustiveness checks, and runtime values of 'parent_domain' are no longer typed.

Migration: Remove 'parent_domain' from any exhaustive checks or type annotations referencing OrganizationDomainOwnershipVerificationStrategy.

Changed: OrganizationDomainVerificationStatus
- type OrganizationDomainVerificationStatus = 'unverified' | 'verified' | 'failed' | 'expired';+ type OrganizationDomainVerificationStatus = 'unverified' | 'verified';

Static analyzer: Breaking change in type alias OrganizationDomainVerificationStatus: Type changed: 'expired'|'failed'|'unverified'|'verified''unverified'|'verified'

🤖 AI review (confirmed) (90%): The 'expired' and 'failed' variants were removed from OrganizationDomainVerificationStatus; consumers reading output fields typed with this union that handle those variants will get type errors under strict/exhaustive checks.

Migration: Remove 'expired' and 'failed' branches from any exhaustive switch/if statements over OrganizationDomainVerificationStatus.

🟡 Non-breaking Changes (1)

Modified: __internal_LocalizationResource
// ... 1297 unchanged lines elided ...
domainCard: {
badge__verified: LocalizationValue;
badge__unverified: LocalizationValue;
- badge__expired: LocalizationValue;
verifiedAtLabel: LocalizationValue<'date'>;
- expiredAtLabel: LocalizationValue<'date'>;- expiredLabel: LocalizationValue;- verifyAgainButton: LocalizationValue;
removeButtonTooltip__lastVerifiedDomain: LocalizationValue;
removeButtonTooltip__lastVerifiedDomainActive: LocalizationValue;
txtRecord: {
// ... 639 unchanged lines elided ...

Static analyzer: Breaking change in type alias __internal_LocalizationResource: Type changed: {locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…{locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…

🤖 AI review (reclassified as non-breaking) (55%): The diff elides 1867 vs 1863 lines suggesting ~4 lines were removed, but __internal_LocalizationResource is used only as an input to DeepLocalizationWithoutObjects via LocalizationResource extends DeepPartial<...>, meaning consumers supply partial overrides; removing optional keys from an output/template type they partially implement is unlikely to break well-typed consumers. Without the full diffed lines it is impossible to be certain, so confidence is low.


@clerk/backend

Version: 3.8.4 → 3.8.3
Recommended bump: MINOR

🟡 Non-breaking Changes (1)

Modified: ExternalAccount.undefined

// ... 12 unchanged lines elided ...
phoneNumber: string | null, publicMetadata: (Record<string, unknown> | null) | undefined, label: string | null, - verification: Verification | null);+ verification: Verification | null, + externalAccountId?: string | undefined);

Static analyzer: Modified constructor ExternalAccount.undefined: Optional parameter externalAccountId was added

🤖 AI review (confirmed) (95%): Adding an optional parameter externalAccountId? at the end of the constructor signature does not break existing callers, since all prior call sites remain valid without providing the new argument.

🟢 Additions (2)

Added: ExternalAccount.externalAccountId

+ readonly externalAccountId?: string | undefined;

Added property ExternalAccount.externalAccountId

Added: ExternalAccountJSON.external_account_id

+ external_account_id?: string;

Added property ExternalAccountJSON.external_account_id


@clerk/ui

Version: 1.23.0 → 1.22.0
Recommended bump: MINOR

Subpath ./internal

🟡 Non-breaking Changes (1)

Modified: ElementsConfig
// ... 490 unchanged lines elided ...
configureSSOVerifyDomainErrorSubtitle: WithOptions;
configureSSOVerifyDomainList: WithOptions;
configureSSOVerifyDomainSuggestion: WithOptions;
- configureSSOVerifyDomainCard: WithOptions<'verified' | 'unverified' | 'expired'>;- configureSSOVerifyDomainCardBadge: WithOptions<'verified' | 'unverified' | 'expired'>;+ configureSSOVerifyDomainCard: WithOptions<'verified' | 'unverified'>;+ configureSSOVerifyDomainCardBadge: WithOptions<'verified' | 'unverified'>;
configureSSOVerifyDomainCardRemoveButton: WithOptions;
configureSSOVerifyDomainCardTxtRecord: WithOptions;
configureSSOVerifyDomainCardTxtRecordValue: WithOptions;
- configureSSOVerifyDomainCardExpired: WithOptions;
configureSSOEmailVerificationForm: WithOptions<string>;
configureSSOEmailVerificationIcon: WithOptions<string>;
configureSSOEmailVerificationTitle: WithOptions<string>;
// ... 51 unchanged lines elided ...

Static analyzer: Breaking change in type alias ElementsConfig: Type changed: {button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…{button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…

🤖 AI review (reclassified as non-breaking) (85%): The elided diff shows 473 vs 472 lines, indicating one property was removed from ElementsConfig; however, ElementsConfig is used only as the key source for the Elements output type alias (a mapped type consumers read, not construct), so removing a key from the config only narrows the set of selectors available — existing consumer code reading Elements values is unaffected, and no consumer constructs an ElementsConfig object directly.


Report generated by Break Check

Last ran on 8f9546d.

Co-authored-by: VihaanAgarwal <vihaan@clique.so>
@jacekradko
jacekradkoforce-pushed the jacek/backend-external-account-id branch from afef28f to 8f9546dCompareJune 26, 2026 12:37
@jacekradko
jacekradko enabled auto-merge (squash) June 26, 2026 12:44
@jacekradko
jacekradko merged commit a8c727c into mainJun 26, 2026
48 checks passed
@jacekradko
jacekradko deleted the jacek/backend-external-account-id branch June 26, 2026 12:45
@jacekradko

Copy link
Copy Markdown
ContributorAuthor

Building on @VihaanAgarwal's original fix in #8982. Added him as co-author on the squash.

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

Labels

Projects

None yet

2 participants

@jacekradko@wobsoriano
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(backend): expose externalAccountId on ExternalAccount resource by jacekradko · Pull Request #8995 · clerk/javascript · GitHub
Skip to content

fix(backend): expose externalAccountId on ExternalAccount resource - #8995

Merged
jacekradko merged 1 commit into
mainfrom
jacek/backend-external-account-id
Jun 26, 2026
Merged

fix(backend): expose externalAccountId on ExternalAccount resource#8995
jacekradko merged 1 commit into
mainfrom
jacek/backend-external-account-id

Conversation

@jacekradko

@jacekradkojacekradko commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

The backend ExternalAccount.id is the idn_ identification id for Google and Facebook accounts, so handing it to users.deleteUserExternalAccount() (which wants the eac_ id) returns a 404. This adds an optional externalAccountId that carries the eac_ value.

The part worth knowing is why it's optional. The Backend API only returns external_account_id for Google and Facebook accounts, where id is the idn_ value. Every other provider already returns id as the eac_ id and no external_account_id. So the deletable id is externalAccountId ?? id, never externalAccountId on its own, and the JSDoc plus changeset say as much. The getUser fixture now carries both a google_account and a generic external_account entry so the test asserts both shapes.

This is an alternative to #8982, which mapped the same field but typed it as a required string and pointed callers at externalAccountId directly, which would 404 for every non-Google/Facebook account.

Fixes#7936
Fixes#7584

Summary by CodeRabbit

  • Bug Fixes

    • Improved how external account IDs are returned for linked social accounts, so account deletion and related actions use the correct identifier.
    • Kept existing behavior for other providers while making the ID mapping more consistent.
  • Tests

    • Added coverage for provider-specific external account ID handling to verify the updated behavior.

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8f9546d

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendPatch
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJun 25, 2026 12:49pm
swingsetReadyReadyPreview, CommentJun 25, 2026 12:49pm

Request Review

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ec22195-d655-48ad-8a14-442afebb4238

📥 Commits

Reviewing files that changed from the base of the PR and between afef28f and 8f9546d.

📒 Files selected for processing (6)
  • .changeset/backend-external-account-id.md
  • packages/backend/src/api/__tests__/factory.test.ts
  • packages/backend/src/api/resources/ExternalAccount.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/api/resources/__tests__/ExternalAccount.test.ts
  • packages/backend/src/fixtures/user.json
✅ Files skipped from review due to trivial changes (2)
  • .changeset/backend-external-account-id.md
  • packages/backend/src/api/tests/factory.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/backend/src/api/resources/ExternalAccount.ts
  • packages/backend/src/api/resources/tests/ExternalAccount.test.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/fixtures/user.json

📝 Walkthrough

Walkthrough

ExternalAccount now carries an optional externalAccountId from external_account_id, while preserving existing id and identificationId mapping. Tests, fixtures, and a changeset were updated for provider-specific external account IDs.

Changes

External account ID mapping

Layer / File(s)Summary
External account contract
packages/backend/src/api/resources/JSON.ts, packages/backend/src/api/resources/ExternalAccount.ts
ExternalAccountJSON adds external_account_id, and ExternalAccount stores it as externalAccountId while reading it from data.external_account_id.
Provider mapping coverage
packages/backend/src/api/__tests__/factory.test.ts, packages/backend/src/api/resources/__tests__/ExternalAccount.test.ts, packages/backend/src/fixtures/user.json, .changeset/backend-external-account-id.md
Tests and fixtures assert the provider-specific mapping for id, identificationId, and externalAccountId, and the changeset records the patch release.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 I hopped through IDs, both new and old,
idn_ and eac_ now shine like gold.
Fixtures bounce, tests nibble neat,
The mapping now feels snug and sweet.
Hoppity hop—what a tidy treat!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly summarizes the main backend ExternalAccount change and is concise.
Linked Issues check✅ PassedThe PR exposes optional externalAccountId while preserving id behavior, matching the linked bug fixes and compatibility requirements.
Out of Scope Changes check✅ PassedAll edits support the ExternalAccount ID fix through code, tests, fixtures, and a changeset; no unrelated changes are present.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@pkg-pr-new

pkg-pr-newBot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@8995

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@8995

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@8995

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 8f9546d

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-06-26T12:40:31.956Z

Summary

MetricCount
Packages analyzed19
Packages with changes3
🔴 Breaking changes5
🟡 Non-breaking changes3
🟢 Additions2

Warning
5 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (5)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/shared./typesOrganizationDomainOwnershipVerification.status
@clerk/shared./typesOrganizationDomainOwnershipVerificationJSON.status
@clerk/shared./typesOrganizationDomainOwnershipVerificationStatus
@clerk/shared./typesOrganizationDomainOwnershipVerificationStrategy
@clerk/shared./typesOrganizationDomainVerificationStatus

@clerk/shared

Version: 4.22.0 → 4.21.0
Recommended bump: MAJOR

Subpath ./types

🔴 Breaking Changes (5)

Changed: OrganizationDomainOwnershipVerification.status
- status: OrganizationDomainOwnershipVerificationStatus;+ status: OrganizationDomainVerificationStatus;

Static analyzer: Breaking change in property OrganizationDomainOwnershipVerification.status: Type changed: import("@clerk/shared").OrganizationDomainOwnershipVerificationStatusimport("@clerk/shared").OrganizationDomainVerificationStatus

🤖 AI review (confirmed) (85%): The status field on OrganizationDomainOwnershipVerification changed from OrganizationDomainOwnershipVerificationStatus ('expired'|'unverified'|'verified') to OrganizationDomainVerificationStatus ('unverified'|'verified'), dropping 'expired'; consumers reading this output field that branch on 'expired' will hit an unhandled case or a type-check error.

Migration: Update any switch/if statements that handle the 'expired' status on OrganizationDomainOwnershipVerification.status to use OrganizationDomainVerificationStatus ('unverified' | 'verified') and remove the 'expired' branch.

Changed: OrganizationDomainOwnershipVerificationJSON.status
- status: OrganizationDomainOwnershipVerificationStatus;+ status: OrganizationDomainVerificationStatus;

Static analyzer: Breaking change in property OrganizationDomainOwnershipVerificationJSON.status: Type changed: import("@clerk/shared").OrganizationDomainOwnershipVerificationStatusimport("@clerk/shared").OrganizationDomainVerificationStatus

🤖 AI review (confirmed) (85%): Same narrowing as b73ffcd5d145 applied to OrganizationDomainOwnershipVerificationJSON.status; the 'expired' variant is removed, breaking consumers that read or switch on this JSON field.

Migration: Update consumers reading OrganizationDomainOwnershipVerificationJSON.status to only handle 'unverified' | 'verified' and remove handling of 'expired'.

Changed: OrganizationDomainOwnershipVerificationStatus
- type OrganizationDomainOwnershipVerificationStatus = 'unverified' | 'verified' | 'expired';

Static analyzer: Removed type alias OrganizationDomainOwnershipVerificationStatus

🤖 AI review (confirmed) (95%): The exported type alias OrganizationDomainOwnershipVerificationStatus has been removed entirely; any consumer that imported or referenced it will fail to compile.

Migration: Replace usages of OrganizationDomainOwnershipVerificationStatus with OrganizationDomainVerificationStatus ('unverified' | 'verified').

Changed: OrganizationDomainOwnershipVerificationStrategy
- type OrganizationDomainOwnershipVerificationStrategy = 'txt' | 'legacy' | 'manual_override' | 'parent_domain';+ type OrganizationDomainOwnershipVerificationStrategy = 'txt' | 'legacy' | 'manual_override';

Static analyzer: Breaking change in type alias OrganizationDomainOwnershipVerificationStrategy: Type changed: 'legacy'|'manual_override'|'parent_domain'|'txt''legacy'|'manual_override'|'txt'

🤖 AI review (confirmed) (90%): The 'parent_domain' variant was removed from OrganizationDomainOwnershipVerificationStrategy; consumers that read this output field and handle 'parent_domain' (e.g., in a switch statement) will have a type error with exhaustiveness checks, and runtime values of 'parent_domain' are no longer typed.

Migration: Remove 'parent_domain' from any exhaustive checks or type annotations referencing OrganizationDomainOwnershipVerificationStrategy.

Changed: OrganizationDomainVerificationStatus
- type OrganizationDomainVerificationStatus = 'unverified' | 'verified' | 'failed' | 'expired';+ type OrganizationDomainVerificationStatus = 'unverified' | 'verified';

Static analyzer: Breaking change in type alias OrganizationDomainVerificationStatus: Type changed: 'expired'|'failed'|'unverified'|'verified''unverified'|'verified'

🤖 AI review (confirmed) (90%): The 'expired' and 'failed' variants were removed from OrganizationDomainVerificationStatus; consumers reading output fields typed with this union that handle those variants will get type errors under strict/exhaustive checks.

Migration: Remove 'expired' and 'failed' branches from any exhaustive switch/if statements over OrganizationDomainVerificationStatus.

🟡 Non-breaking Changes (1)

Modified: __internal_LocalizationResource
// ... 1297 unchanged lines elided ...
domainCard: {
badge__verified: LocalizationValue;
badge__unverified: LocalizationValue;
- badge__expired: LocalizationValue;
verifiedAtLabel: LocalizationValue<'date'>;
- expiredAtLabel: LocalizationValue<'date'>;- expiredLabel: LocalizationValue;- verifyAgainButton: LocalizationValue;
removeButtonTooltip__lastVerifiedDomain: LocalizationValue;
removeButtonTooltip__lastVerifiedDomainActive: LocalizationValue;
txtRecord: {
// ... 639 unchanged lines elided ...

Static analyzer: Breaking change in type alias __internal_LocalizationResource: Type changed: {locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…{locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…

🤖 AI review (reclassified as non-breaking) (55%): The diff elides 1867 vs 1863 lines suggesting ~4 lines were removed, but __internal_LocalizationResource is used only as an input to DeepLocalizationWithoutObjects via LocalizationResource extends DeepPartial<...>, meaning consumers supply partial overrides; removing optional keys from an output/template type they partially implement is unlikely to break well-typed consumers. Without the full diffed lines it is impossible to be certain, so confidence is low.


@clerk/backend

Version: 3.8.4 → 3.8.3
Recommended bump: MINOR

🟡 Non-breaking Changes (1)

Modified: ExternalAccount.undefined

// ... 12 unchanged lines elided ...
phoneNumber: string | null, publicMetadata: (Record<string, unknown> | null) | undefined, label: string | null, - verification: Verification | null);+ verification: Verification | null, + externalAccountId?: string | undefined);

Static analyzer: Modified constructor ExternalAccount.undefined: Optional parameter externalAccountId was added

🤖 AI review (confirmed) (95%): Adding an optional parameter externalAccountId? at the end of the constructor signature does not break existing callers, since all prior call sites remain valid without providing the new argument.

🟢 Additions (2)

Added: ExternalAccount.externalAccountId

+ readonly externalAccountId?: string | undefined;

Added property ExternalAccount.externalAccountId

Added: ExternalAccountJSON.external_account_id

+ external_account_id?: string;

Added property ExternalAccountJSON.external_account_id


@clerk/ui

Version: 1.23.0 → 1.22.0
Recommended bump: MINOR

Subpath ./internal

🟡 Non-breaking Changes (1)

Modified: ElementsConfig
// ... 490 unchanged lines elided ...
configureSSOVerifyDomainErrorSubtitle: WithOptions;
configureSSOVerifyDomainList: WithOptions;
configureSSOVerifyDomainSuggestion: WithOptions;
- configureSSOVerifyDomainCard: WithOptions<'verified' | 'unverified' | 'expired'>;- configureSSOVerifyDomainCardBadge: WithOptions<'verified' | 'unverified' | 'expired'>;+ configureSSOVerifyDomainCard: WithOptions<'verified' | 'unverified'>;+ configureSSOVerifyDomainCardBadge: WithOptions<'verified' | 'unverified'>;
configureSSOVerifyDomainCardRemoveButton: WithOptions;
configureSSOVerifyDomainCardTxtRecord: WithOptions;
configureSSOVerifyDomainCardTxtRecordValue: WithOptions;
- configureSSOVerifyDomainCardExpired: WithOptions;
configureSSOEmailVerificationForm: WithOptions<string>;
configureSSOEmailVerificationIcon: WithOptions<string>;
configureSSOEmailVerificationTitle: WithOptions<string>;
// ... 51 unchanged lines elided ...

Static analyzer: Breaking change in type alias ElementsConfig: Type changed: {button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…{button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…

🤖 AI review (reclassified as non-breaking) (85%): The elided diff shows 473 vs 472 lines, indicating one property was removed from ElementsConfig; however, ElementsConfig is used only as the key source for the Elements output type alias (a mapped type consumers read, not construct), so removing a key from the config only narrows the set of selectors available — existing consumer code reading Elements values is unaffected, and no consumer constructs an ElementsConfig object directly.


Report generated by Break Check

Last ran on 8f9546d.

Co-authored-by: VihaanAgarwal <vihaan@clique.so>
@jacekradko
jacekradkoforce-pushed the jacek/backend-external-account-id branch from afef28f to 8f9546dCompareJune 26, 2026 12:37
@jacekradko
jacekradko enabled auto-merge (squash) June 26, 2026 12:44
@jacekradko
jacekradko merged commit a8c727c into mainJun 26, 2026
48 checks passed
@jacekradko
jacekradko deleted the jacek/backend-external-account-id branch June 26, 2026 12:45
@jacekradko

Copy link
Copy Markdown
ContributorAuthor

Building on @VihaanAgarwal's original fix in #8982. Added him as co-author on the squash.

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

Labels

Projects

None yet

2 participants

@jacekradko@wobsoriano
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); fix(backend): expose externalAccountId on ExternalAccount resource by jacekradko · Pull Request #8995 · clerk/javascript · GitHub
Skip to content

fix(backend): expose externalAccountId on ExternalAccount resource - #8995

Merged
jacekradko merged 1 commit into
mainfrom
jacek/backend-external-account-id
Jun 26, 2026
Merged

fix(backend): expose externalAccountId on ExternalAccount resource#8995
jacekradko merged 1 commit into
mainfrom
jacek/backend-external-account-id

Conversation

@jacekradko

@jacekradkojacekradko commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

The backend ExternalAccount.id is the idn_ identification id for Google and Facebook accounts, so handing it to users.deleteUserExternalAccount() (which wants the eac_ id) returns a 404. This adds an optional externalAccountId that carries the eac_ value.

The part worth knowing is why it's optional. The Backend API only returns external_account_id for Google and Facebook accounts, where id is the idn_ value. Every other provider already returns id as the eac_ id and no external_account_id. So the deletable id is externalAccountId ?? id, never externalAccountId on its own, and the JSDoc plus changeset say as much. The getUser fixture now carries both a google_account and a generic external_account entry so the test asserts both shapes.

This is an alternative to #8982, which mapped the same field but typed it as a required string and pointed callers at externalAccountId directly, which would 404 for every non-Google/Facebook account.

Fixes#7936
Fixes#7584

Summary by CodeRabbit

  • Bug Fixes

    • Improved how external account IDs are returned for linked social accounts, so account deletion and related actions use the correct identifier.
    • Kept existing behavior for other providers while making the ID mapping more consistent.
  • Tests

    • Added coverage for provider-specific external account ID handling to verify the updated behavior.

@changeset-bot

changeset-botBot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8f9546d

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

This PR includes changesets to release 10 packages
NameType
@clerk/backendPatch
@clerk/astroPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/honoPatch
@clerk/nextjsPatch
@clerk/nuxtPatch
@clerk/react-routerPatch
@clerk/tanstack-react-startPatch
@clerk/testingPatch

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

vercelBot commented Jun 25, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
clerk-js-sandboxReadyReadyPreview, CommentJun 25, 2026 12:49pm
swingsetReadyReadyPreview, CommentJun 25, 2026 12:49pm

Request Review

@coderabbitai

coderabbitaiBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ec22195-d655-48ad-8a14-442afebb4238

📥 Commits

Reviewing files that changed from the base of the PR and between afef28f and 8f9546d.

📒 Files selected for processing (6)
  • .changeset/backend-external-account-id.md
  • packages/backend/src/api/__tests__/factory.test.ts
  • packages/backend/src/api/resources/ExternalAccount.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/api/resources/__tests__/ExternalAccount.test.ts
  • packages/backend/src/fixtures/user.json
✅ Files skipped from review due to trivial changes (2)
  • .changeset/backend-external-account-id.md
  • packages/backend/src/api/tests/factory.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/backend/src/api/resources/ExternalAccount.ts
  • packages/backend/src/api/resources/tests/ExternalAccount.test.ts
  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/fixtures/user.json

📝 Walkthrough

Walkthrough

ExternalAccount now carries an optional externalAccountId from external_account_id, while preserving existing id and identificationId mapping. Tests, fixtures, and a changeset were updated for provider-specific external account IDs.

Changes

External account ID mapping

Layer / File(s)Summary
External account contract
packages/backend/src/api/resources/JSON.ts, packages/backend/src/api/resources/ExternalAccount.ts
ExternalAccountJSON adds external_account_id, and ExternalAccount stores it as externalAccountId while reading it from data.external_account_id.
Provider mapping coverage
packages/backend/src/api/__tests__/factory.test.ts, packages/backend/src/api/resources/__tests__/ExternalAccount.test.ts, packages/backend/src/fixtures/user.json, .changeset/backend-external-account-id.md
Tests and fixtures assert the provider-specific mapping for id, identificationId, and externalAccountId, and the changeset records the patch release.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 I hopped through IDs, both new and old,
idn_ and eac_ now shine like gold.
Fixtures bounce, tests nibble neat,
The mapping now feels snug and sweet.
Hoppity hop—what a tidy treat!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly summarizes the main backend ExternalAccount change and is concise.
Linked Issues check✅ PassedThe PR exposes optional externalAccountId while preserving id behavior, matching the linked bug fixes and compatibility requirements.
Out of Scope Changes check✅ PassedAll edits support the ExternalAccount ID fix through code, tests, fixtures, and a changeset; no unrelated changes are present.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@pkg-pr-new

pkg-pr-newBot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@8995

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@8995

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@8995

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 8f9546d

@github-actions

github-actionsBot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-06-26T12:40:31.956Z

Summary

MetricCount
Packages analyzed19
Packages with changes3
🔴 Breaking changes5
🟡 Non-breaking changes3
🟢 Additions2

Warning
5 breaking change(s) detected - Major version bump required

🤖 This report was reviewed by claude-sonnet-4-6.

🔴 Breaking changes index (5)

Every breaking change, up front. Full diffs are in the package sections below.

PackageSubpathChange
@clerk/shared./typesOrganizationDomainOwnershipVerification.status
@clerk/shared./typesOrganizationDomainOwnershipVerificationJSON.status
@clerk/shared./typesOrganizationDomainOwnershipVerificationStatus
@clerk/shared./typesOrganizationDomainOwnershipVerificationStrategy
@clerk/shared./typesOrganizationDomainVerificationStatus

@clerk/shared

Version: 4.22.0 → 4.21.0
Recommended bump: MAJOR

Subpath ./types

🔴 Breaking Changes (5)

Changed: OrganizationDomainOwnershipVerification.status
- status: OrganizationDomainOwnershipVerificationStatus;+ status: OrganizationDomainVerificationStatus;

Static analyzer: Breaking change in property OrganizationDomainOwnershipVerification.status: Type changed: import("@clerk/shared").OrganizationDomainOwnershipVerificationStatusimport("@clerk/shared").OrganizationDomainVerificationStatus

🤖 AI review (confirmed) (85%): The status field on OrganizationDomainOwnershipVerification changed from OrganizationDomainOwnershipVerificationStatus ('expired'|'unverified'|'verified') to OrganizationDomainVerificationStatus ('unverified'|'verified'), dropping 'expired'; consumers reading this output field that branch on 'expired' will hit an unhandled case or a type-check error.

Migration: Update any switch/if statements that handle the 'expired' status on OrganizationDomainOwnershipVerification.status to use OrganizationDomainVerificationStatus ('unverified' | 'verified') and remove the 'expired' branch.

Changed: OrganizationDomainOwnershipVerificationJSON.status
- status: OrganizationDomainOwnershipVerificationStatus;+ status: OrganizationDomainVerificationStatus;

Static analyzer: Breaking change in property OrganizationDomainOwnershipVerificationJSON.status: Type changed: import("@clerk/shared").OrganizationDomainOwnershipVerificationStatusimport("@clerk/shared").OrganizationDomainVerificationStatus

🤖 AI review (confirmed) (85%): Same narrowing as b73ffcd5d145 applied to OrganizationDomainOwnershipVerificationJSON.status; the 'expired' variant is removed, breaking consumers that read or switch on this JSON field.

Migration: Update consumers reading OrganizationDomainOwnershipVerificationJSON.status to only handle 'unverified' | 'verified' and remove handling of 'expired'.

Changed: OrganizationDomainOwnershipVerificationStatus
- type OrganizationDomainOwnershipVerificationStatus = 'unverified' | 'verified' | 'expired';

Static analyzer: Removed type alias OrganizationDomainOwnershipVerificationStatus

🤖 AI review (confirmed) (95%): The exported type alias OrganizationDomainOwnershipVerificationStatus has been removed entirely; any consumer that imported or referenced it will fail to compile.

Migration: Replace usages of OrganizationDomainOwnershipVerificationStatus with OrganizationDomainVerificationStatus ('unverified' | 'verified').

Changed: OrganizationDomainOwnershipVerificationStrategy
- type OrganizationDomainOwnershipVerificationStrategy = 'txt' | 'legacy' | 'manual_override' | 'parent_domain';+ type OrganizationDomainOwnershipVerificationStrategy = 'txt' | 'legacy' | 'manual_override';

Static analyzer: Breaking change in type alias OrganizationDomainOwnershipVerificationStrategy: Type changed: 'legacy'|'manual_override'|'parent_domain'|'txt''legacy'|'manual_override'|'txt'

🤖 AI review (confirmed) (90%): The 'parent_domain' variant was removed from OrganizationDomainOwnershipVerificationStrategy; consumers that read this output field and handle 'parent_domain' (e.g., in a switch statement) will have a type error with exhaustiveness checks, and runtime values of 'parent_domain' are no longer typed.

Migration: Remove 'parent_domain' from any exhaustive checks or type annotations referencing OrganizationDomainOwnershipVerificationStrategy.

Changed: OrganizationDomainVerificationStatus
- type OrganizationDomainVerificationStatus = 'unverified' | 'verified' | 'failed' | 'expired';+ type OrganizationDomainVerificationStatus = 'unverified' | 'verified';

Static analyzer: Breaking change in type alias OrganizationDomainVerificationStatus: Type changed: 'expired'|'failed'|'unverified'|'verified''unverified'|'verified'

🤖 AI review (confirmed) (90%): The 'expired' and 'failed' variants were removed from OrganizationDomainVerificationStatus; consumers reading output fields typed with this union that handle those variants will get type errors under strict/exhaustive checks.

Migration: Remove 'expired' and 'failed' branches from any exhaustive switch/if statements over OrganizationDomainVerificationStatus.

🟡 Non-breaking Changes (1)

Modified: __internal_LocalizationResource
// ... 1297 unchanged lines elided ...
domainCard: {
badge__verified: LocalizationValue;
badge__unverified: LocalizationValue;
- badge__expired: LocalizationValue;
verifiedAtLabel: LocalizationValue<'date'>;
- expiredAtLabel: LocalizationValue<'date'>;- expiredLabel: LocalizationValue;- verifyAgainButton: LocalizationValue;
removeButtonTooltip__lastVerifiedDomain: LocalizationValue;
removeButtonTooltip__lastVerifiedDomainActive: LocalizationValue;
txtRecord: {
// ... 639 unchanged lines elided ...

Static analyzer: Breaking change in type alias __internal_LocalizationResource: Type changed: {locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…{locale:string;maintenanceMode:import("@clerk/shared").LocalizationValue;roles:{[r:string]:import("@clerk/shared").Loca…

🤖 AI review (reclassified as non-breaking) (55%): The diff elides 1867 vs 1863 lines suggesting ~4 lines were removed, but __internal_LocalizationResource is used only as an input to DeepLocalizationWithoutObjects via LocalizationResource extends DeepPartial<...>, meaning consumers supply partial overrides; removing optional keys from an output/template type they partially implement is unlikely to break well-typed consumers. Without the full diffed lines it is impossible to be certain, so confidence is low.


@clerk/backend

Version: 3.8.4 → 3.8.3
Recommended bump: MINOR

🟡 Non-breaking Changes (1)

Modified: ExternalAccount.undefined

// ... 12 unchanged lines elided ...
phoneNumber: string | null, publicMetadata: (Record<string, unknown> | null) | undefined, label: string | null, - verification: Verification | null);+ verification: Verification | null, + externalAccountId?: string | undefined);

Static analyzer: Modified constructor ExternalAccount.undefined: Optional parameter externalAccountId was added

🤖 AI review (confirmed) (95%): Adding an optional parameter externalAccountId? at the end of the constructor signature does not break existing callers, since all prior call sites remain valid without providing the new argument.

🟢 Additions (2)

Added: ExternalAccount.externalAccountId

+ readonly externalAccountId?: string | undefined;

Added property ExternalAccount.externalAccountId

Added: ExternalAccountJSON.external_account_id

+ external_account_id?: string;

Added property ExternalAccountJSON.external_account_id


@clerk/ui

Version: 1.23.0 → 1.22.0
Recommended bump: MINOR

Subpath ./internal

🟡 Non-breaking Changes (1)

Modified: ElementsConfig
// ... 490 unchanged lines elided ...
configureSSOVerifyDomainErrorSubtitle: WithOptions;
configureSSOVerifyDomainList: WithOptions;
configureSSOVerifyDomainSuggestion: WithOptions;
- configureSSOVerifyDomainCard: WithOptions<'verified' | 'unverified' | 'expired'>;- configureSSOVerifyDomainCardBadge: WithOptions<'verified' | 'unverified' | 'expired'>;+ configureSSOVerifyDomainCard: WithOptions<'verified' | 'unverified'>;+ configureSSOVerifyDomainCardBadge: WithOptions<'verified' | 'unverified'>;
configureSSOVerifyDomainCardRemoveButton: WithOptions;
configureSSOVerifyDomainCardTxtRecord: WithOptions;
configureSSOVerifyDomainCardTxtRecordValue: WithOptions;
- configureSSOVerifyDomainCardExpired: WithOptions;
configureSSOEmailVerificationForm: WithOptions<string>;
configureSSOEmailVerificationIcon: WithOptions<string>;
configureSSOEmailVerificationTitle: WithOptions<string>;
// ... 51 unchanged lines elided ...

Static analyzer: Breaking change in type alias ElementsConfig: Type changed: {button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…{button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…

🤖 AI review (reclassified as non-breaking) (85%): The elided diff shows 473 vs 472 lines, indicating one property was removed from ElementsConfig; however, ElementsConfig is used only as the key source for the Elements output type alias (a mapped type consumers read, not construct), so removing a key from the config only narrows the set of selectors available — existing consumer code reading Elements values is unaffected, and no consumer constructs an ElementsConfig object directly.


Report generated by Break Check

Last ran on 8f9546d.

Co-authored-by: VihaanAgarwal <vihaan@clique.so>
@jacekradko
jacekradkoforce-pushed the jacek/backend-external-account-id branch from afef28f to 8f9546dCompareJune 26, 2026 12:37
@jacekradko
jacekradko enabled auto-merge (squash) June 26, 2026 12:44
@jacekradko
jacekradko merged commit a8c727c into mainJun 26, 2026
48 checks passed
@jacekradko
jacekradko deleted the jacek/backend-external-account-id branch June 26, 2026 12:45
@jacekradko

Copy link
Copy Markdown
ContributorAuthor

Building on @VihaanAgarwal's original fix in #8982. Added him as co-author on the squash.

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

Labels

Projects

None yet

2 participants

@jacekradko@wobsoriano