Repository navigation
Conversation
Clerk is adding an enterpriseConnection.created webhook whose payload is the Backend API enterprise connection object. Add it to WebhookEvent so verifyWebhook() narrows the event to EnterpriseConnectionJSON. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 7cb10ba The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-native-components
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
|
API Changes Report
Summary
@clerk/backendCurrent version: 3.31.4 Subpath
|
The enterpriseConnection.created webhook no longer sends the full Backend API enterprise connection object. Clerk now sends only the connection's id, organization_id, domains, active and created_at, so typing the event as EnterpriseConnectionJSON would promise fields like name, provider and saml_connection that never arrive. Add EnterpriseConnectionWebhookEventJSON with those five fields and narrow the event to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The webhook payload type was missing the object field Clerk now sends, and its type test compared the payload to EnterpriseConnectionWebhookEventJSON itself, so a changed or dropped field still passed. The branch also carried redirect_uri and directory_path on the nested enterprise connection JSON types from an earlier version of this PR; the resource classes drop both in fromJSON, so SDK users never see them. Add object: 'enterprise_connection' to the payload type, compare the test against the literal wire shape, remove the two unused fields, move the payload type next to EnterpriseConnectionJSON, and document that created_at is in milliseconds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Description
Clerk is adding an
enterpriseConnection.createdwebhook, sent whenever an enterprise (SSO) connection is created: through the Backend API, through organization self-serve SSO, or in the Dashboard.WebhookEventdoesn't know this event type, soverifyWebhook()can't narrow it, and a handler that switches onevt.typegets no typed payload for it.This adds
EnterpriseConnectionWebhookEventtoWebhookEventand exports it, with a newEnterpriseConnectionWebhookEventJSONpayload type. The webhook carriesobject: 'enterprise_connection'and only the connection'sid,organization_id,domains,activeandcreated_at, not the full Backend API object, so a handler that needs the name, provider or SAML/OAuth details fetches the connection byid.data.idkeeps thestring | undefinedtype existing handlers rely on across all events.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
🤖 Generated with Claude Code