@clerk/upgrade 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/guide-generators/text-generation.js +109 -0
- package/dist/guide-generators/v5/backend/__output.mdx +580 -0
- package/dist/guide-generators/v5/backend/import-moves.mdx +3 -0
- package/dist/guide-generators/v5/backend/import-paths.mdx +3 -0
- package/dist/guide-generators/v5/backend/index.js +22 -0
- package/dist/guide-generators/v5/backend/intro.mdx +3 -0
- package/dist/guide-generators/v5/chrome-extension/index.js +19 -0
- package/dist/guide-generators/v5/chrome-extension/intro.mdx +3 -0
- package/dist/guide-generators/v5/chromeExtension/__output.mdx +409 -0
- package/dist/guide-generators/v5/chromeExtension/index.js +24 -0
- package/dist/guide-generators/v5/chromeExtension/intro.mdx +3 -0
- package/dist/guide-generators/v5/expo/__output.mdx +455 -0
- package/dist/guide-generators/v5/expo/index.js +24 -0
- package/dist/guide-generators/v5/expo/intro.mdx +3 -0
- package/dist/guide-generators/v5/fastify/__output.mdx +373 -0
- package/dist/guide-generators/v5/fastify/index.js +22 -0
- package/dist/guide-generators/v5/fastify/intro.mdx +3 -0
- package/dist/guide-generators/v5/gatsby/__output.mdx +472 -0
- package/dist/guide-generators/v5/gatsby/index.js +24 -0
- package/dist/guide-generators/v5/gatsby/intro.mdx +3 -0
- package/dist/guide-generators/v5/generate-all.js +0 -0
- package/dist/guide-generators/v5/generate-all.sh +16 -0
- package/dist/guide-generators/v5/generate.js +263 -0
- package/dist/guide-generators/v5/intro.mdx +15 -0
- package/dist/guide-generators/v5/js/__output.mdx +528 -0
- package/dist/guide-generators/v5/js/index.js +27 -0
- package/dist/guide-generators/v5/js/intro.mdx +3 -0
- package/dist/guide-generators/v5/js/pagination-args.mdx +3 -0
- package/dist/guide-generators/v5/js/pagination-return.mdx +3 -0
- package/dist/guide-generators/v5/nextjs/__output.mdx +1091 -0
- package/dist/guide-generators/v5/nextjs/after-sign-x-handling.mdx +10 -0
- package/dist/guide-generators/v5/nextjs/deprecation-removals.mdx +9 -0
- package/dist/guide-generators/v5/nextjs/import-changes.mdx +98 -0
- package/dist/guide-generators/v5/nextjs/index.js +24 -0
- package/dist/guide-generators/v5/nextjs/intro.mdx +3 -0
- package/dist/guide-generators/v5/nextjs/middleware-changes.mdx +251 -0
- package/dist/guide-generators/v5/nextjs/nextjs-versio.mdx +34 -0
- package/dist/guide-generators/v5/nextjs/nextjs-version.mdx +6 -0
- package/dist/guide-generators/v5/nextjs/retheme-changes.mdx +10 -0
- package/dist/guide-generators/v5/nextjs/version-requirements.mdx +34 -0
- package/dist/guide-generators/v5/node/__output.mdx +511 -0
- package/dist/guide-generators/v5/node/index.js +22 -0
- package/dist/guide-generators/v5/node/intro.mdx +3 -0
- package/dist/guide-generators/v5/node/node-setters-removals.mdx +34 -0
- package/dist/guide-generators/v5/overview/__output.mdx +37 -0
- package/dist/guide-generators/v5/overview/index.js +12 -0
- package/dist/guide-generators/v5/overview/intro.mdx +31 -0
- package/dist/guide-generators/v5/overview/per-sdk.mdx +16 -0
- package/dist/guide-generators/v5/per-sdk.mdx +16 -0
- package/dist/guide-generators/v5/prepare.mdx +135 -0
- package/dist/guide-generators/v5/react/__output.mdx +679 -0
- package/dist/guide-generators/v5/react/hof-removals.mdx +3 -0
- package/dist/guide-generators/v5/react/index.js +24 -0
- package/dist/guide-generators/v5/react/intro.mdx +3 -0
- package/dist/guide-generators/v5/redesigned-components.mdx +11 -0
- package/dist/guide-generators/v5/remix/__output.mdx +401 -0
- package/dist/guide-generators/v5/remix/index.js +24 -0
- package/dist/guide-generators/v5/remix/intro.mdx +3 -0
- package/dist/guide-generators/v5/retheme/__output.mdx +437 -0
- package/dist/guide-generators/v5/retheme/index.js +24 -0
- package/dist/guide-generators/v5/retheme/intro.mdx +9 -0
- package/dist/guide-generators/v5/shared/after-sign-x-handling.mdx +10 -0
- package/dist/guide-generators/v5/shared/cli.mdx +22 -0
- package/dist/guide-generators/v5/shared/deprecation-removals.mdx +6 -0
- package/dist/guide-generators/v5/shared/hof-removals.mdx +3 -0
- package/dist/guide-generators/v5/shared/image-url.mdx +3 -0
- package/dist/guide-generators/v5/shared/node-setters-removals.mdx +34 -0
- package/dist/guide-generators/v5/shared/node-version.mdx +3 -0
- package/dist/guide-generators/v5/shared/orgs-claim.mdx +50 -0
- package/dist/guide-generators/v5/shared/pagination-args.mdx +3 -0
- package/dist/guide-generators/v5/shared/pagination-return.mdx +3 -0
- package/dist/guide-generators/v5/shared/path-routing.mdx +57 -0
- package/dist/guide-generators/v5/shared/prepare.mdx +10 -0
- package/dist/guide-generators/v5/shared/react-version.mdx +20 -0
- package/dist/guide-generators/v5/shared/redesign-preview.mdx +5 -0
- package/dist/guide-generators/v5/shared/update-v5.mdx +17 -0
- package/dist/guide-generators/v5/shared/update-version.mdx +18 -0
- package/dist/guide-generators/v5/single-page-old.js +192 -0
- package/dist/guide-generators/v5-guides/deprecation-removals.mdx +7 -0
- package/dist/guide-generators/v5-guides/generate.js +263 -0
- package/dist/guide-generators/v5-guides/hof-removals.mdx +3 -0
- package/dist/guide-generators/v5-guides/intro.mdx +15 -0
- package/dist/guide-generators/v5-guides/nextjs/after-sign-x-handling.mdx +10 -0
- package/dist/guide-generators/v5-guides/nextjs/deprecation-removals.mdx +9 -0
- package/dist/guide-generators/v5-guides/nextjs/import-changes.mdx +98 -0
- package/dist/guide-generators/v5-guides/nextjs/index.js +80 -0
- package/dist/guide-generators/v5-guides/nextjs/intro.mdx +21 -0
- package/dist/guide-generators/v5-guides/nextjs/middleware-changes.mdx +251 -0
- package/dist/guide-generators/v5-guides/nextjs/retheme-changes.mdx +10 -0
- package/dist/guide-generators/v5-guides/nextjs/version-requirements.mdx +34 -0
- package/dist/guide-generators/v5-guides/node-setters-removals.mdx +34 -0
- package/dist/guide-generators/v5-guides/pagination-args.mdx +3 -0
- package/dist/guide-generators/v5-guides/pagination-return.mdx +3 -0
- package/dist/guide-generators/v5-guides/path-routing.mdx +50 -0
- package/dist/guide-generators/v5-guides/per-sdk.mdx +16 -0
- package/dist/guide-generators/v5-guides/prepare.mdx +135 -0
- package/dist/guide-generators/v5-guides/redesign-preview.mdx +5 -0
- package/dist/guide-generators/v5-guides/redesigned-components.mdx +11 -0
- package/dist/guide-generators/v5-guides/remix/index.js +15 -0
- package/dist/guide-generators/v5-guides/remix/intro.mdx +1 -0
- package/dist/guide-generators/v5-guides/remix/output.mdx +362 -0
- package/dist/guide-generators/v5-guides/shared/breaking-changes-intro.mdx +0 -0
- package/dist/guide-generators/v5-guides/shared/cli.mdx +21 -0
- package/dist/guide-generators/v5-guides/shared/deprecation-removals.mdx +7 -0
- package/dist/guide-generators/v5-guides/shared/hof-removals.mdx +3 -0
- package/dist/guide-generators/v5-guides/shared/node-setters-removals.mdx +34 -0
- package/dist/guide-generators/v5-guides/shared/node-version.mdx +3 -0
- package/dist/guide-generators/v5-guides/shared/pagination-args.mdx +3 -0
- package/dist/guide-generators/v5-guides/shared/pagination-return.mdx +3 -0
- package/dist/guide-generators/v5-guides/shared/path-routing.mdx +50 -0
- package/dist/guide-generators/v5-guides/shared/prepare.mdx +7 -0
- package/dist/guide-generators/v5-guides/shared/react-version.mdx +19 -0
- package/dist/guide-generators/v5-guides/shared/redesign-preview.mdx +5 -0
- package/dist/guide-generators/v5-guides/shared/update-v5.mdx +17 -0
- package/dist/guide-generators/v5-guides/shared/upgrade-v5.mdx +17 -0
- package/dist/scan.js +4 -2
- package/dist/util/generate-nextjs-migration-guide.js +0 -0
- package/dist/util/generate-nextjs-v5-migration-guide.js +0 -0
- package/dist/util/load-change.js +1 -0
- package/dist/util/text-generation.js +29 -0
- package/dist/util/v5-guide/deprecation-removals.mdx +7 -0
- package/dist/util/v5-guide/generate.js +200 -0
- package/dist/util/v5-guide/getting-up-to-date.mdx +114 -0
- package/dist/util/v5-guide/hof-removals.mdx +3 -0
- package/dist/util/v5-guide/intro.mdx +15 -0
- package/dist/util/v5-guide/node-setters-removals.mdx +34 -0
- package/dist/util/v5-guide/pagination-args.mdx +3 -0
- package/dist/util/v5-guide/pagination-return.mdx +3 -0
- package/dist/util/v5-guide/path-routing.mdx +50 -0
- package/dist/util/v5-guide/per-sdk.mdx +16 -0
- package/dist/util/v5-guide/prepare.mdx +135 -0
- package/dist/util/v5-guide/redesign-preview.mdx +5 -0
- package/dist/util/v5-guide/redesigned-components.mdx +11 -0
- package/dist/util/v5-guide/remix.mdx +0 -0
- package/dist/util/v5-guides/deprecation-removals.mdx +7 -0
- package/dist/util/v5-guides/generate.js +200 -0
- package/dist/util/v5-guides/hof-removals.mdx +3 -0
- package/dist/util/v5-guides/intro.mdx +15 -0
- package/dist/util/v5-guides/nextjs/after-sign-x-handling.mdx +10 -0
- package/dist/util/v5-guides/nextjs/deprecation-removals.mdx +9 -0
- package/dist/util/v5-guides/nextjs/generate.js +80 -0
- package/dist/util/v5-guides/nextjs/import-changes.mdx +98 -0
- package/dist/util/v5-guides/nextjs/index.js +0 -0
- package/dist/util/v5-guides/nextjs/intro.mdx +21 -0
- package/dist/util/v5-guides/nextjs/middleware-changes.mdx +251 -0
- package/dist/util/v5-guides/nextjs/retheme-changes.mdx +10 -0
- package/dist/util/v5-guides/nextjs/version-requirements.mdx +34 -0
- package/dist/util/v5-guides/node-setters-removals.mdx +34 -0
- package/dist/util/v5-guides/pagination-args.mdx +3 -0
- package/dist/util/v5-guides/pagination-return.mdx +3 -0
- package/dist/util/v5-guides/path-routing.mdx +50 -0
- package/dist/util/v5-guides/per-sdk.mdx +16 -0
- package/dist/util/v5-guides/prepare.mdx +135 -0
- package/dist/util/v5-guides/redesign-preview.mdx +5 -0
- package/dist/util/v5-guides/redesigned-components.mdx +11 -0
- package/dist/util/v5-guides/remix/index.js +5 -0
- package/dist/util/v5-nextjs-guide/after-sign-x-handling.mdx +10 -0
- package/dist/util/v5-nextjs-guide/deprecation-removals.mdx +9 -0
- package/dist/util/v5-nextjs-guide/generate-nextjs-v5-migration-guide.js +0 -0
- package/dist/util/v5-nextjs-guide/generate.js +80 -0
- package/dist/util/v5-nextjs-guide/import-changes.mdx +98 -0
- package/dist/util/v5-nextjs-guide/intro.md +0 -0
- package/dist/util/v5-nextjs-guide/intro.mdx +21 -0
- package/dist/util/v5-nextjs-guide/middleware-changes.mdx +251 -0
- package/dist/util/v5-nextjs-guide/retheme-changes.mdx +11 -0
- package/dist/util/v5-nextjs-guide/version-requirements.mdx +34 -0
- package/dist/versions/v5/backend/appearance-organizationpreview-organizationswitcher.md +9 -0
- package/dist/versions/v5/backend/authenticaterequest-params-change.md +1 -0
- package/dist/versions/v5/backend/clockskewinseconds.md +1 -0
- package/dist/versions/v5/backend/constants-import-path-move.md +1 -0
- package/dist/versions/v5/backend/createauthenticaterequest-import-path-move.md +1 -0
- package/dist/versions/v5/backend/createclerkclient-apikey.md +1 -0
- package/dist/versions/v5/backend/createclerkclient-frontendapi.md +1 -0
- package/dist/versions/v5/backend/createisomorphicrequest-import-path-move.md +1 -0
- package/dist/versions/v5/backend/createisomorphicrequest-removed.md +1 -0
- package/dist/versions/v5/backend/decodejwt-import-path-move.md +1 -0
- package/dist/versions/v5/backend/externalaccount-picture.md +1 -0
- package/dist/versions/v5/backend/externalaccountjson-avatarurl.md +1 -0
- package/dist/versions/v5/backend/getorganizationinvitationlist-return-signature.md +1 -0
- package/dist/versions/v5/backend/getorganizationinvitationlist-return-type-change.md +17 -0
- package/dist/versions/v5/backend/getorganizationlist-return-signature.md +1 -0
- package/dist/versions/v5/backend/getorganizationmembershiplist-return-signature.md +1 -0
- package/dist/versions/v5/backend/httpoptions-removed.md +2 -1
- package/dist/versions/v5/backend/organizationjson-logourl.md +1 -0
- package/dist/versions/v5/backend/organizationmembershippublicuserdatajson-profileimageurl.md +1 -0
- package/dist/versions/v5/backend/redirect-import-path-move.md +1 -0
- package/dist/versions/v5/backend/signjwt-import-path-move.md +1 -0
- package/dist/versions/v5/backend/signjwterror-import-move.md +1 -0
- package/dist/versions/v5/backend/tokenverificationerror-import-move.md +1 -0
- package/dist/versions/v5/backend/tokenverificationerroraction-import-move.md +1 -0
- package/dist/versions/v5/backend/tokenverificationerrorcode-import-move.md +1 -0
- package/dist/versions/v5/backend/tokenverificationerrorreason-import-move.md +1 -0
- package/dist/versions/v5/backend/userjson-profileimageurl.md +1 -0
- package/dist/versions/v5/backend/verifyjwt-import-path-move.md +1 -0
- package/dist/versions/v5/chromeExtension/clerkprovider-tokencache.md +8 -10
- package/dist/versions/v5/common/aftersigninurl-behavior-change-2.md +1 -0
- package/dist/versions/v5/common/aftersignouturl-behavior-change.md +1 -0
- package/dist/versions/v5/common/aftersignupurl-behavior-change.md +1 -0
- package/dist/versions/v5/common/afterswitchorganizationurl.md +1 -0
- package/dist/versions/v5/common/alternativemethods-backlink.md +1 -0
- package/dist/versions/v5/common/api-key-to-secret-key.md +1 -0
- package/dist/versions/v5/common/appearance-organizationpreview-organizationswitcher.md +1 -0
- package/dist/versions/v5/common/button-to-organizationlistcreateorganizationactionbutton.md +1 -0
- package/dist/versions/v5/common/card-changes.md +3 -2
- package/dist/versions/v5/common/changed-localization-keys.md +121 -120
- package/dist/versions/v5/common/clerkprovider-frontendapi-2.md +1 -0
- package/dist/versions/v5/common/clerkprovideroptionswrapper-dropped.md +1 -0
- package/dist/versions/v5/common/connected-accounts-dropdown.md +1 -0
- package/dist/versions/v5/common/emaillinkerrorcode-import-change.md +1 -0
- package/dist/versions/v5/common/externalaccount-avatarurl.md +7 -0
- package/dist/versions/v5/common/externalaccount-picture.md +7 -0
- package/dist/versions/v5/common/externalaccountjson-avatarurl.md +7 -0
- package/dist/versions/v5/common/frontend-api-to-publishable-key.md +1 -0
- package/dist/versions/v5/common/getorganizationinvitationlist-return-signature.md +15 -0
- package/dist/versions/v5/common/getorganizationinvitationlist-return-type-change.md +8 -5
- package/dist/versions/v5/common/getorganizationlist-return-signature.md +15 -0
- package/dist/versions/v5/common/getorganizationlist-return-type-change.md +2 -1
- package/dist/versions/v5/common/getorganizationmembershiplist-return-type-change.md +2 -1
- package/dist/versions/v5/common/isclerkapiresponserror-import-change.md +1 -0
- package/dist/versions/v5/common/isemaillinkerror-import-change.md +1 -0
- package/dist/versions/v5/common/isknownerror-import-change.md +1 -0
- package/dist/versions/v5/common/ismetamaskerror-import-change.md +6 -5
- package/dist/versions/v5/common/mfa-dropdown.md +1 -0
- package/dist/versions/v5/common/min-react-version.md +2 -0
- package/dist/versions/v5/common/multisessionappsupport-import-change.md +1 -1
- package/dist/versions/v5/common/navigate-to-routerpush-routerreplace.md +1 -0
- package/dist/versions/v5/common/new-localization-keys.md +121 -120
- package/dist/versions/v5/common/organization-create-string.md +12 -0
- package/dist/versions/v5/common/organization-getdomains-arguments-change.md +1 -0
- package/dist/versions/v5/common/organization-getinvitations-arguments-changed.md +1 -0
- package/dist/versions/v5/common/organization-getmembershiprequests-arguments-changed.md +1 -0
- package/dist/versions/v5/common/organization-getmemberships-arguments-changed.md +1 -0
- package/dist/versions/v5/common/organization-getpendinginvitations.md +11 -0
- package/dist/versions/v5/common/organization-getroles-arguments-changed.md +1 -0
- package/dist/versions/v5/common/organization-logourl.md +8 -0
- package/dist/versions/v5/common/organizationmembershippublicuserdata-profileimageurl.md +7 -0
- package/dist/versions/v5/common/organizationprofile-settings.md +1 -0
- package/dist/versions/v5/common/organizationswitcherpopoveractionbuttontext-removed.md +1 -0
- package/dist/versions/v5/common/remove-identitypreview-avatar.md +1 -0
- package/dist/versions/v5/common/remove-socialbuttonsblockbuttonarrow.md +1 -0
- package/dist/versions/v5/common/removed-localization-keys.md +74 -73
- package/dist/versions/v5/common/user-getorganizationinvitations-arguments-chanaged.md +1 -0
- package/dist/versions/v5/common/user-getorganizationinvitations-arguments-changed.md +16 -0
- package/dist/versions/v5/common/user-getorganizationmemberships-arguments-chanaged.md +1 -0
- package/dist/versions/v5/common/user-getorganizationmemberships-arguments-changed.md +16 -0
- package/dist/versions/v5/common/user-getorganizationsuggestions-arguments-chanaged.md +1 -0
- package/dist/versions/v5/common/user-getorganizationsuggestions-arguments-changed.md +16 -0
- package/dist/versions/v5/common/user-profileimageurl.md +7 -0
- package/dist/versions/v5/common/user-update-password.md +18 -0
- package/dist/versions/v5/common/userbuttonpopoveractionbuttontext-removed.md +1 -0
- package/dist/versions/v5/common/userbuttontrigger-userbuttonbox-invert.md +2 -1
- package/dist/versions/v5/common/userprofile-security.md +1 -0
- package/dist/versions/v5/common/withclerk-hof-removed.md +15 -14
- package/dist/versions/v5/common/withclerk-removed.md +1 -0
- package/dist/versions/v5/common/withsession-hof-removed.md +15 -14
- package/dist/versions/v5/common/withsession-removed.md +1 -0
- package/dist/versions/v5/common/withuser-hof-removed.md +15 -14
- package/dist/versions/v5/common/withuser-removed-2.md +1 -2
- package/dist/versions/v5/expo/apikey-to-publishable-key.md +1 -0
- package/dist/versions/v5/expo/clerkprovider-frontendapi.md +1 -0
- package/dist/versions/v5/fastify/clerkplugin-frontendapi.md +2 -1
- package/dist/versions/v5/fastify/createclerkclient-apikey.md +1 -0
- package/dist/versions/v5/fastify/createclerkclient-frontendapi.md +1 -0
- package/dist/versions/v5/gatsby/api-url-value-change.md +1 -1
- package/dist/versions/v5/gatsby/apikey-to-publishable-key.md +1 -0
- package/dist/versions/v5/gatsby/createclerkclient-apikey.md +1 -0
- package/dist/versions/v5/gatsby/createclerkclient-frontendapi.md +1 -0
- package/dist/versions/v5/gatsby/withserverauth-return-type.md +22 -30
- package/dist/versions/v5/index.js +16 -26
- package/dist/versions/v5/js/experimental-canusecaptcha.md +1 -0
- package/dist/versions/v5/js/experimental-captchasitekey.md +1 -0
- package/dist/versions/v5/js/experimental-captchaurl.md +1 -0
- package/dist/versions/v5/js/getorganizationmemberships.md +3 -6
- package/dist/versions/v5/js/redirecttohome.md +4 -4
- package/dist/versions/v5/js/signup-attemptweb3walletverification-generatedsignature.md +3 -2
- package/dist/versions/v5/js/unstable-invitationupdate.md +1 -0
- package/dist/versions/v5/js/unstable-membershipupdate.md +1 -0
- package/dist/versions/v5/js/user-createexternalaccount-redirecturl.md +1 -0
- package/dist/versions/v5/js/user-update-password.md +8 -9
- package/dist/versions/v5/next/auth-import-change.md +1 -0
- package/dist/versions/v5/next/auth-middleware-deprecated.md +8 -7
- package/dist/versions/v5/next/authmiddleware-apikey.md +5 -7
- package/dist/versions/v5/next/authmiddleware-frontendapi.md +2 -1
- package/dist/versions/v5/next/authmiddleware-import-change.md +1 -0
- package/dist/versions/v5/next/buildclerkprops-import-change.md +1 -0
- package/dist/versions/v5/next/clerk-import-change.md +1 -0
- package/dist/versions/v5/next/clerk-js-version-next-public.md +1 -0
- package/dist/versions/v5/next/constants-import-change.md +2 -1
- package/dist/versions/v5/next/createauthenticaterequest-import-change.md +1 -0
- package/dist/versions/v5/next/createclerkclient-apikey.md +2 -1
- package/dist/versions/v5/next/createclerkclient-frontendapi.md +2 -1
- package/dist/versions/v5/next/createisomorphicrequest-import-change.md +1 -0
- package/dist/versions/v5/next/currentuser-import-change.md +1 -0
- package/dist/versions/v5/next/decodejwt-import-change.md +1 -0
- package/dist/versions/v5/next/emaillinkerrorcode-import-change.md +1 -0
- package/dist/versions/v5/next/getauth-apikey.md +2 -1
- package/dist/versions/v5/next/import-api-url.md +2 -1
- package/dist/versions/v5/next/import-api-version.md +2 -1
- package/dist/versions/v5/next/import-clerk-js-url.md +2 -1
- package/dist/versions/v5/next/import-clerk-js-version.md +2 -1
- package/dist/versions/v5/next/import-domain.md +2 -1
- package/dist/versions/v5/next/import-is-satellite.md +2 -1
- package/dist/versions/v5/next/import-nextjs-api.md +7 -6
- package/dist/versions/v5/next/import-nextjs-app-beta.md +2 -1
- package/dist/versions/v5/next/import-nextjs-edge-middleware.md +1 -0
- package/dist/versions/v5/next/import-nextjs-edge-middlewarefiles.md +1 -0
- package/dist/versions/v5/next/import-nextjs-ssr.md +1 -0
- package/dist/versions/v5/next/import-proxy-url.md +2 -1
- package/dist/versions/v5/next/import-publishable-key.md +2 -1
- package/dist/versions/v5/next/import-secret-key.md +2 -1
- package/dist/versions/v5/next/import-sign-in-url.md +2 -1
- package/dist/versions/v5/next/import-sign-up-url.md +2 -1
- package/dist/versions/v5/next/isclerkapiresponserror-import-change.md +1 -0
- package/dist/versions/v5/next/isemaillinkerror-import-change.md +1 -0
- package/dist/versions/v5/next/isknownerror-import-change.md +1 -0
- package/dist/versions/v5/next/ismetamaskerror-import-change.md +1 -0
- package/dist/versions/v5/next/min-nextjs-version.md +2 -0
- package/dist/versions/v5/next/multisessionappsupport-import-change.md +1 -0
- package/dist/versions/v5/next/next-public-clerk-js-url.md +2 -1
- package/dist/versions/v5/next/redirect-import-change.md +1 -0
- package/dist/versions/v5/next/redirecttosignin-import-path.md +2 -1
- package/dist/versions/v5/next/redirecttosignup-import-path.md +2 -1
- package/dist/versions/v5/next/signjwt-import-change.md +1 -0
- package/dist/versions/v5/next/verifyjwt-import-change.md +1 -0
- package/dist/versions/v5/next/verifytoken-import-change.md +1 -0
- package/dist/versions/v5/next/with-clerk-middleware-removed.md +1 -0
- package/dist/versions/v5/nextjs/api-url-value-change.md +8 -0
- package/dist/versions/v5/nextjs/auth-import-change.md +14 -0
- package/dist/versions/v5/nextjs/auth-middleware-deprecated.md +50 -0
- package/dist/versions/v5/nextjs/authmiddleware-apikey.md +15 -0
- package/dist/versions/v5/nextjs/authmiddleware-frontendapi.md +15 -0
- package/dist/versions/v5/nextjs/authmiddleware-import-change.md +14 -0
- package/dist/versions/v5/nextjs/buildclerkprops-import-change.md +14 -0
- package/dist/versions/v5/nextjs/clerk-import-change.md +13 -0
- package/dist/versions/v5/nextjs/clerk-js-version-next-public.md +9 -0
- package/dist/versions/v5/nextjs/constants-import-change.md +14 -0
- package/dist/versions/v5/nextjs/createauthenticaterequest-import-change.md +14 -0
- package/dist/versions/v5/nextjs/createclerkclient-apikey.md +15 -0
- package/dist/versions/v5/nextjs/createclerkclient-frontendapi.md +15 -0
- package/dist/versions/v5/nextjs/createisomorphicrequest-import-change.md +14 -0
- package/dist/versions/v5/nextjs/currentuser-import-change.md +14 -0
- package/dist/versions/v5/nextjs/decodejwt-import-change.md +14 -0
- package/dist/versions/v5/nextjs/emaillinkerrorcode-import-change.md +14 -0
- package/dist/versions/v5/nextjs/getauth-apikey.md +13 -0
- package/dist/versions/v5/nextjs/import-api-url.md +8 -0
- package/dist/versions/v5/nextjs/import-api-version.md +8 -0
- package/dist/versions/v5/nextjs/import-clerk-js-url.md +8 -0
- package/dist/versions/v5/nextjs/import-clerk-js-version.md +8 -0
- package/dist/versions/v5/nextjs/import-domain.md +8 -0
- package/dist/versions/v5/nextjs/import-is-satellite.md +8 -0
- package/dist/versions/v5/nextjs/import-nextjs-api.md +21 -0
- package/dist/versions/v5/nextjs/import-nextjs-app-beta.md +11 -0
- package/dist/versions/v5/nextjs/import-nextjs-edge-middleware.md +7 -0
- package/dist/versions/v5/nextjs/import-nextjs-edge-middlewarefiles.md +7 -0
- package/dist/versions/v5/nextjs/import-nextjs-ssr.md +8 -0
- package/dist/versions/v5/nextjs/import-proxy-url.md +8 -0
- package/dist/versions/v5/nextjs/import-publishable-key.md +8 -0
- package/dist/versions/v5/nextjs/import-secret-key.md +8 -0
- package/dist/versions/v5/nextjs/import-sign-in-url.md +8 -0
- package/dist/versions/v5/nextjs/import-sign-up-url.md +8 -0
- package/dist/versions/v5/nextjs/isclerkapiresponserror-import-change.md +14 -0
- package/dist/versions/v5/nextjs/isemaillinkerror-import-change.md +14 -0
- package/dist/versions/v5/nextjs/isknownerror-import-change.md +14 -0
- package/dist/versions/v5/nextjs/min-nextjs-version.md +11 -0
- package/dist/versions/v5/nextjs/multisessionappsupport-import-change.md +14 -0
- package/dist/versions/v5/nextjs/next-public-clerk-js-url.md +7 -0
- package/dist/versions/v5/nextjs/redirect-import-change.md +14 -0
- package/dist/versions/v5/nextjs/redirecttosignin-import-path.md +13 -0
- package/dist/versions/v5/nextjs/redirecttosignup-import-path.md +13 -0
- package/dist/versions/v5/nextjs/signjwt-import-change.md +14 -0
- package/dist/versions/v5/nextjs/verifyjwt-import-change.md +14 -0
- package/dist/versions/v5/nextjs/verifytoken-import-change.md +14 -0
- package/dist/versions/v5/nextjs/with-clerk-middleware-removed.md +56 -0
- package/dist/versions/v5/node/cjs-esm-instance.md +1 -0
- package/dist/versions/v5/node/clerkexpressrequireauth-apikey.md +1 -0
- package/dist/versions/v5/node/clerkexpressrequireauth-frontendapi.md +1 -0
- package/dist/versions/v5/node/clerkexpresswithauth-apikey.md +1 -0
- package/dist/versions/v5/node/clerkexpresswithauth-frontendapi.md +1 -0
- package/dist/versions/v5/node/createclerkclient-apikey.md +1 -0
- package/dist/versions/v5/node/createclerkclient-frontendapi.md +1 -0
- package/dist/versions/v5/node/createclerkexpressrequireauth-apikey.md +1 -0
- package/dist/versions/v5/node/createclerkexpressrequireauth-frontendapi.md +1 -0
- package/dist/versions/v5/node/createclerkexpresswithauth-apikey.md +1 -0
- package/dist/versions/v5/node/createclerkexpresswithauth-frontendapi.md +1 -0
- package/dist/versions/v5/node/legacyauthobject-removed.md +3 -3
- package/dist/versions/v5/node/setclerkapikey.md +1 -0
- package/dist/versions/v5/node/setclerkapiversion.md +1 -0
- package/dist/versions/v5/node/setclerkhttpoptions.md +1 -0
- package/dist/versions/v5/node/setclerkserverapiurl.md +1 -0
- package/dist/versions/v5/react/api-url-value-change.md +1 -1
- package/dist/versions/v5/remix/clerk-import-change.md +1 -0
- package/dist/versions/v5/remix/clerkerrorboundary-removed.md +1 -0
- package/dist/versions/v5/remix/createclerkclient-apikey.md +1 -0
- package/dist/versions/v5/remix/getauth-apikey.md +1 -0
- package/dist/versions/v5/remix/rootauthloader-apikey.md +1 -0
- package/dist/versions/v5/remix/rootauthloader-frontendapi.md +1 -0
- package/package.json +5 -2
|
@@ -0,0 +1,679 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Upgrading React to Core 2"
|
|
3
|
+
description: "Learn how to upgrade Clerk's React SDK to the latest version."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Upgrading `@clerk/clerk-react` to Core 2
|
|
7
|
+
|
|
8
|
+
Clerk's Core 2 release includes a new major version of the React SDK, v5. This new version ships with an improved design and UX for its built-in components, no "flash of white page" when authenticating, and a variety of smaller DX improvements and housekeeping items. Each of the potentially breaking changes are detailed in this guide, below.
|
|
9
|
+
|
|
10
|
+
By the end of this guide, you’ll have successfully upgraded your React project to use `@clerk/clerk-react` v5. You’ll learn how to update your dependencies, resolve breaking changes, and find deprecations. Step-by-step instructions will lead you through the process.
|
|
11
|
+
|
|
12
|
+
## Preparing to upgrade
|
|
13
|
+
|
|
14
|
+
Before uprading, it's highly recommended that you update your Clerk SDKs to the latest Core 1 version (`npm i @clerk/clerk-react@core-1`). Some changes required for Core 2 can be applied incrementally to the latest v5 release, which should contribute to a smoother upgrading experience.
|
|
15
|
+
|
|
16
|
+
After updating, look out for deprecation messages in your terminal and browser console. By resolving these deprecations you'll be able to skip many breaking changes from Core 2.
|
|
17
|
+
|
|
18
|
+
<Callout>
|
|
19
|
+
Note that Core 2 is currently in beta, while we field feedback and ensure stability. Deploying beta versions to
|
|
20
|
+
production is not recommended and should be done at your own risk.
|
|
21
|
+
</Callout>
|
|
22
|
+
|
|
23
|
+
Additionally, some of the minumum version requirements for some base dependencies have been updated such that versions that are no longer supported or are at end-of-life are no longer guaranteed to work correctly with Clerk.
|
|
24
|
+
|
|
25
|
+
**Updating Node.js**
|
|
26
|
+
|
|
27
|
+
You need to have Node.js `18.17.0` or later installed. Last year, Node.js 16 entered EOL (End of life) status, so support for this version has been removed across Clerk SDKs. You can check your Node.js version by running `node -v` in your terminal. Learn more about how to [update and install Node.js](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs).
|
|
28
|
+
|
|
29
|
+
**Updating React**
|
|
30
|
+
|
|
31
|
+
All react-dependent Clerk SDKs now require you to use React 18 or higher. You can update your project by installing the latest version of `react` and `react-dom`.
|
|
32
|
+
|
|
33
|
+
<CodeBlockTabs type="installer" options={["npm", "yarn", "pnpm"]}>
|
|
34
|
+
```bash filename="terminal"
|
|
35
|
+
npm install react@latest react-dom@latest
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```bash filename="terminal"
|
|
39
|
+
yarn add react@latest react-dom@latest
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```bash filename="terminal"
|
|
43
|
+
pnpm add react@latest react-dom@latest
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
</CodeBlockTabs>
|
|
47
|
+
|
|
48
|
+
If you are upgrading from React 17 or lower, make sure to [learn about how to upgrade your React version to 18](https://react.dev/blog/2022/03/08/react-18-upgrade-guide) as well.
|
|
49
|
+
|
|
50
|
+
## Updating to Core 2 Beta
|
|
51
|
+
|
|
52
|
+
Whenever you feel ready, go ahead and install the latest beta version of any Clerk SDKs you are using. Make sure that you are prepared to patch some breaking changes before your app will work properly, however. The commands below demonstrate how to install the latest beta.
|
|
53
|
+
|
|
54
|
+
<CodeBlockTabs type="installer" options={["npm", "yarn", "pnpm"]}>
|
|
55
|
+
```bash filename="terminal"
|
|
56
|
+
npm install @clerk/clerk-react@beta
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```bash filename="terminal"
|
|
60
|
+
yarn add @clerk/clerk-react@beta
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```bash filename="terminal"
|
|
64
|
+
pnpm add @clerk/clerk-react@beta
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
</CodeBlockTabs>
|
|
68
|
+
|
|
69
|
+
## CLI Upgrade Helper
|
|
70
|
+
|
|
71
|
+
As of this major version Clerk provides a `@clerk/upgrade` CLI tool that you can use to ease the upgrade. A CLI prompt will ask you a couple of questions, it will scan your codebase, and afterwards you'll get a list of changes you'll need to apply to your project, as well as the locations where they need to be applied. This should catch the vast majority of the changes needed for a successful upgrade, and can save a lot of time reading through changes to things that aren't actually in your project.
|
|
72
|
+
|
|
73
|
+
To run the CLI tool, navigate to your project and run it in the terminal:
|
|
74
|
+
|
|
75
|
+
<CodeBlockTabs type="installer" options={["npm", "yarn", "pnpm"]}>
|
|
76
|
+
```bash filename="terminal"
|
|
77
|
+
npx @clerk/upgrade
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```bash filename="terminal"
|
|
81
|
+
yarn dlx @clerk/upgrade
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```bash filename="terminal"
|
|
85
|
+
pnpm dlx @clerk/upgrade
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
</CodeBlockTabs>
|
|
89
|
+
|
|
90
|
+
If you are having trouble with `npx`, it's also possible to install directly with `npm i @clerk/upgrade -g`, and can then be run with the `clerk-upgrade` command.
|
|
91
|
+
|
|
92
|
+
## Breaking Changes
|
|
93
|
+
|
|
94
|
+
### Component design adjustments
|
|
95
|
+
|
|
96
|
+
The new version ships with improved design and UX across all of Clerk's [UI components](/docs/components/overview). If you have used the [`appearance` prop](/docs/components/customization/overview) or tokens for a [custom theme](/docs/components/customization/overview#create-a-custom-theme), you will likely need to make some adjustments to ensure your styling is still looking great. If you're using the [localization prop](/docs/components/customization/localization) you will likely need to make adjustments to account for added or removed localization keys.
|
|
97
|
+
|
|
98
|
+
[More detail on these changes »](/components-redesigned)
|
|
99
|
+
|
|
100
|
+
### After sign up/in/out URL handling
|
|
101
|
+
|
|
102
|
+
Defining redirect URLs for after sign up, in, and/or out via the Clerk dashboard has been removed in Core 2. In your Clerk dashboard, under "paths", there is a section called "Component paths", where URLs could be defined that had a deprecation warning. In Core 2, this functionality has been removed, and specifying redirect paths via the dashboard will no longer work. If you need to pass a redirect URL for after sign in/up/out, there are [a few different ways this can be done](https://clerk.com/docs/account-portal/custom-redirects), from environment variables to middleware to supplying them directly to the relevant components.
|
|
103
|
+
|
|
104
|
+
As part of this change, the default URL for each of these props has been set to `/`, so if you are passing `/` explicitly to any one of the above props, that line is no longer necessary and can be removed.
|
|
105
|
+
|
|
106
|
+
```diff
|
|
107
|
+
- <UserButton afterSignOutUrl='/' />
|
|
108
|
+
+ <UserButton />
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### `navigate` prop to `ClerkProvider` replaced by `routerPush` and `routerReplace`
|
|
112
|
+
|
|
113
|
+
The `navigate` prop on ClerkProvider allowed developers to override the default navigation behavior with a custom function. However, navigate was only able to push, not replace routes. We have now added the capability for the router to push or replace, and as such, upgraded the provider prop so that it can handle either depending on the circumstance.
|
|
114
|
+
|
|
115
|
+
Two new props have been added to `ClerkProvider` that replace the single `navigate` prop, and can be used to override the default navigation behavior for either a push or replace navigation. For more information on what push and replace mean in relation to the browser history api, [check out these wonderful MDN docs](https://developer.mozilla.org/en-US/docs/Web/API/History_API/Working_with_the_History_API).
|
|
116
|
+
|
|
117
|
+
If you’d like to keep the same behavior as you had with the single `navigate` prop, pass the exact same function to both `routerPush` and `routerReplace` and the behavior will be identical. For example:
|
|
118
|
+
|
|
119
|
+
```diff
|
|
120
|
+
- <ClerkProvider navigate={ x => x } />
|
|
121
|
+
+ <ClerkProvider routerPush={ x => x } routerReplace={ x => x } />
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
However, you now have the option to differentiate behavior based on whether the navigation will be a push or replace.
|
|
125
|
+
|
|
126
|
+
### Removed: `orgs` claim on JWT
|
|
127
|
+
|
|
128
|
+
In the previous version of Clerk's SDKs, if you decode the session token that Clerk returns from the server, you'll currently find an `orgs` claim on it. It lists all the orgs associated with the given user. Now, Clerk returns the `org_id`, `org_slug`, and `org_role` of the **active** organization.
|
|
129
|
+
|
|
130
|
+
The `orgs` claim was part of the `JwtPayload`. Here are a few examples of where the `JwtPayload` could be found.
|
|
131
|
+
|
|
132
|
+
<Accordion titles={["Next.js", "Fastify", "@clerk/backend", "@clerk/clerk-sdk-node"]} heading="h5">
|
|
133
|
+
<AccordionPanel>
|
|
134
|
+
```typescript filename="Next.js"
|
|
135
|
+
import { getAuth } from "@clerk/nextjs/server"
|
|
136
|
+
const claims: JwtPayload = getAuth(request).sessionClaims
|
|
137
|
+
|
|
138
|
+
import { getAuth } from "@clerk/ssr.server"
|
|
139
|
+
const claims: JwtPayload = (await getAuth(request)).sessionClaims
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
</AccordionPanel>
|
|
143
|
+
<AccordionPanel>
|
|
144
|
+
```typescript filename="Fastify"
|
|
145
|
+
import { getAuth } from "@clerk/fastify"
|
|
146
|
+
const claims: JwtPayload = (await getAuth(request)).sessionClaims
|
|
147
|
+
```
|
|
148
|
+
</AccordionPanel>
|
|
149
|
+
<AccordionPanel>
|
|
150
|
+
```typescript filename="@clerk/backend"
|
|
151
|
+
import { createClerkClient } from "@clerk/backend"
|
|
152
|
+
|
|
153
|
+
const clerkClient = createClerkClient({ secretKey: "" })
|
|
154
|
+
const requestState = await clerkClient.authenticateRequest(
|
|
155
|
+
request,
|
|
156
|
+
{ publishableKey: "" }
|
|
157
|
+
)
|
|
158
|
+
const claims: JwtPayload = requestState.toAuth().sessionClaims
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
</AccordionPanel>
|
|
162
|
+
<AccordionPanel>
|
|
163
|
+
```typescript filename="@clerk/clerk-sdk-node"
|
|
164
|
+
import { clerkClient } from "@clerk/clerk-sdk-node"
|
|
165
|
+
|
|
166
|
+
router.use((...args) => clerkClient.expressRequireAuth()(...args))
|
|
167
|
+
router.get("/me", async (req, reply: Response) => {
|
|
168
|
+
return reply.json({ auth: req.auth })
|
|
169
|
+
})
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
</AccordionPanel>
|
|
173
|
+
</Accordion>
|
|
174
|
+
|
|
175
|
+
If you would like to have your JWT return all of the user's organizations, you can create a [custom JWT template](/docs/backend-requests/making/jwt-templates) in your dashboard. Add `{ "orgs": "user.organizations" }` to it.
|
|
176
|
+
|
|
177
|
+
### Path routing is now the default
|
|
178
|
+
|
|
179
|
+
On components like [`<SignIn />`](/docs/components/authentication/sign-in) you can define the props `routing` and `path`. `routing` can be set to `'hash' | 'path' | 'virtual'` and describes the routing strategy that should be used. `path` defines where the component is mounted when `routing="path"` is used.
|
|
180
|
+
|
|
181
|
+
In the latest version, the **default** `routing` strategy has become `'path'`. Unless you change the `routing` prop, you'll need to define the `path` prop. The affected components are:
|
|
182
|
+
|
|
183
|
+
- `<SignIn />`
|
|
184
|
+
- `<SignUp />`
|
|
185
|
+
- `<UserProfile />`
|
|
186
|
+
- `<CreateOrganization />`
|
|
187
|
+
- `<OrganizationProfile />`
|
|
188
|
+
|
|
189
|
+
Here's how you'd use the components going forward:
|
|
190
|
+
|
|
191
|
+
```jsx
|
|
192
|
+
<SignIn path="/sign-in" />
|
|
193
|
+
<SignUp path="/sign-up" />
|
|
194
|
+
<UserProfile path="/user-profile" />
|
|
195
|
+
<CreateOrganization path="/create-org" />
|
|
196
|
+
<OrganizationProfile path="/org-profile" />
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
If you don't define the `path` prop an error will be thrown. Of course, you can still use `routing="hash"` or `routing="virtual"`.
|
|
200
|
+
|
|
201
|
+
```jsx
|
|
202
|
+
<UserProfile routing="hash" />
|
|
203
|
+
<OrganizationProfile routing="virtual" />
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
### Image URL Name Consolidation
|
|
209
|
+
|
|
210
|
+
There are a number of Clerk primitives that contain images, and previously they each had different property names, like `avatarUrl`, `logoUrl`, `profileImageUrl`, etc. In order to promote consistency and make it simpler for developers to know where to find associated images, all image properties are now named `imageUrl`. See the list below for all affected classes:
|
|
211
|
+
|
|
212
|
+
<Accordion titles={["<code>Organization.logoUrl</code> -> <code>Organization.imageUrl</code>", "<code>User.profileImageUrl</code> -> <code>.imageUrl</code>", "<code>ExternalAccount.avatarUrl</code> -> <code>.imageUrl</code>", "<code>OrganizationMembershipPublicUserData.profileImageUrl</code> -> <code>.imageUrl</code>"]}>
|
|
213
|
+
<AccordionPanel>
|
|
214
|
+
The `logoUrl` property of any [`Organization` object](https://clerk.com/docs/references/javascript/organization/organization#organization) has been changed to `imageUrl`.
|
|
215
|
+
</AccordionPanel>
|
|
216
|
+
<AccordionPanel>
|
|
217
|
+
The `profileImageUrl` property of any `User` object has been changed to `imageUrl`.
|
|
218
|
+
</AccordionPanel>
|
|
219
|
+
<AccordionPanel>
|
|
220
|
+
The `avatarUrl` property of any [`ExternalAcccount` object](https://clerk.com/docs/references/javascript/external-account) has been changed to `imageUrl`.
|
|
221
|
+
</AccordionPanel>
|
|
222
|
+
<AccordionPanel>
|
|
223
|
+
The `profileImageUrl` property of any `OrganizationMembershipPublicUserData` object has been changed to `imageUrl`.
|
|
224
|
+
</AccordionPanel>
|
|
225
|
+
</Accordion>
|
|
226
|
+
|
|
227
|
+
### Deprecation removals & housekeeping
|
|
228
|
+
|
|
229
|
+
As part of this major version, a number of previously deprecated props, arugments, methods, etc have been removed. Additionally there have been some changes to things that are only used internally, or only used very rarely. It's highly unlikely that any given app will encounter any of these items, but they are all breaking changes, so they have all been documented below.
|
|
230
|
+
|
|
231
|
+
<Callout type='info'>
|
|
232
|
+
For this section more than any other one, please use the CLI upgrade tool (`npx @clerk/upgrade`). Changes in this
|
|
233
|
+
section are very unlikely to appear in your codebase, the tool will save time looking for them.
|
|
234
|
+
</Callout>
|
|
235
|
+
|
|
236
|
+
#### Deprecation removals
|
|
237
|
+
|
|
238
|
+
<Accordion titles={["<code>User.update({ password: 'x' })</code> -> <code>User.updatePassword('x')</code>", "<code>frontendApi</code> -> <code>publishableKey</code> as prop to <code>ClerkProvider</code>", "<code>afterSwitchOrganizationUrl</code> -> <code>afterSelectOrganizationUrl</code> in <code>OrganizationSwitcher</code>", "<code>ClerkProviderOptionsWrapper</code> type removed"]}>
|
|
239
|
+
<AccordionPanel>
|
|
240
|
+
If you are updating a user's password via the [`User.update` method](https://clerk.com/docs/references/javascript/user/user#update), it must be changed to [`User.updatePassword`](https://clerk.com/docs/references/javascript/user/password-management#update-password) instead. This method will require the current password as well as the desired new password. We made this update to improve the security of password changes. Example below:
|
|
241
|
+
|
|
242
|
+
```diff
|
|
243
|
+
- user.update({ password: 'foo' });
|
|
244
|
+
|
|
245
|
+
+ user.updatePassword({
|
|
246
|
+
+ currentPassword: 'bar',
|
|
247
|
+
+ newPassword: 'foo',
|
|
248
|
+
+ signOutOfOtherSessions: true,
|
|
249
|
+
+ });
|
|
250
|
+
```
|
|
251
|
+
</AccordionPanel>
|
|
252
|
+
<AccordionPanel>
|
|
253
|
+
The `frontendApi` prop passed to `<ClerkProvider>` was renamed to `publishableKey`. **Note:** The values are different, so this is not just a key replacement. You can visit your [Clerk dashboard](https://dashboard.clerk.com/last-active?path=api-keys) to copy/paste the new keys after choosing your framework. Make sure to update this in all environments (e.g. dev, staging, production). [More information](/docs/deployments/overview#api-keys-and-environment-variables).
|
|
254
|
+
</AccordionPanel>
|
|
255
|
+
<AccordionPanel>
|
|
256
|
+
The `afterSwitchOrganizationUrl` prop on the `<OrganizationSwitcher />` component has been renamed to `afterSelectOrganizationUrl`. This is a quick and simple rename.
|
|
257
|
+
|
|
258
|
+
```diff
|
|
259
|
+
- <OrganizationSwitcher afterSwitchOrganizationUrl='...' />
|
|
260
|
+
+ <OrganizationSwitcher afterSelectOrganizationUrl='...' />
|
|
261
|
+
```
|
|
262
|
+
</AccordionPanel>
|
|
263
|
+
<AccordionPanel>
|
|
264
|
+
This type was extending `ClerkProviderProps` with but was not necessary. This type is typically used internally and is not required to be imported and used directly. If needed, import and use `ClerkProviderProps` instead.
|
|
265
|
+
</AccordionPanel>
|
|
266
|
+
</Accordion>
|
|
267
|
+
|
|
268
|
+
#### Other Breaking Changes
|
|
269
|
+
|
|
270
|
+
<Accordion titles={["<code>Organization.getRoles</code> arguments changed", "<code>Organization.getMemberships</code> arguments changed", "<code>Organization.getDomains</code> arguments changed", "<code>Organization.getInvitations</code> arguments changed", "<code>Organization.getMembershipRequests</code> arguments changed", "<code>User.getOrganizationInvitations</code> arguments changed", "<code>User.getOrganizationSuggestions</code> arguments changed", "<code>User.getOrganizationMemberships</code> arguments changed", "<code>Users.getOrganizationInvitationList</code> return signature changed", "<code>Organizations.getOrganizationInvitationList</code> return type changed", "<code>User.getOrganizationMembershipList</code> return type changed", "<code>Users.getOrganizationList</code> return signature changed", "<code>Organization.getOrganizationList</code> return type changed", "<code>MagicLinkErrorCode</code> -> <code>EmailLinkErrorCode</code>", "<code>useMagicLink</code> -> <code>useEmailLink</code>", "<code>isMagicLinkError</code> -> <code>isEmailLinkError</code>", "<code>MagicLinkError</code> -> <code>EmailLinkError</code>", "<code>handleMagicLinkVerification</code> -> <code>handleEmailLinkVerification</code>", "<code>setSession</code> -> <code>setActive</code>", "<code>invitationList</code> -> <code>invitations</code> as param to <code>useOrganizations</code>", "<code>membershipList</code> -> <code>members</code> as param to <code>useOrganization</code>", "<code>useOrganizations</code> -> <code>useOrganizationList</code>", "<code>userProfile</code> -> <code>userProfileProps</code> for <code>UserButton</code>", "<code>WithSession</code> component removed", "<code>WithClerk</code> component removed", "<code>WithUser</code> component removed", "<code>withClerk</code> function removed", "<code>withSession</code> function removed", "<code>withUser</code> function removed", "<code>MultisessionAppSupport</code> import moved to <code>/internal</code>", "Replace <code>signOutCallback</code> prop on <code>SignOutButton</code> with <code>redirectUrl</code>"]}>
|
|
271
|
+
<AccordionPanel>
|
|
272
|
+
There have been a couple changes to the pagination arguments that can be passed into this function - `limit` has been renamed to `pageSize`, and `offset` has been renamed to `initialPage`. This will help to make it more clear and simple to reason about pagination control. Example of how changes might look below:
|
|
273
|
+
|
|
274
|
+
```diff
|
|
275
|
+
const { data } = await organization.getRoles({
|
|
276
|
+
- limit: 10,
|
|
277
|
+
+ pageSize: 10,
|
|
278
|
+
- offset: 10,
|
|
279
|
+
+ initialPage: 2,
|
|
280
|
+
})
|
|
281
|
+
```
|
|
282
|
+
</AccordionPanel>
|
|
283
|
+
<AccordionPanel>
|
|
284
|
+
There have been a couple changes to the pagination arguments that can be passed into this function - `limit` has been renamed to `pageSize`, and `offset` has been renamed to `initialPage`. This will help to make it more clear and simple to reason about pagination control. Example of how changes might look below:
|
|
285
|
+
|
|
286
|
+
```diff
|
|
287
|
+
const { data } = await organization.getMemberships({
|
|
288
|
+
- limit: 10,
|
|
289
|
+
+ pageSize: 10,
|
|
290
|
+
- offset: 10,
|
|
291
|
+
+ initialPage: 2,
|
|
292
|
+
})
|
|
293
|
+
```
|
|
294
|
+
</AccordionPanel>
|
|
295
|
+
<AccordionPanel>
|
|
296
|
+
There have been a couple changes to the pagination arguments that can be passed into this function - `limit` has been renamed to `pageSize`, and `offset` has been renamed to `initialPage`. This will help to make it more clear and simple to reason about pagination control. Example of how changes might look below:
|
|
297
|
+
|
|
298
|
+
```diff
|
|
299
|
+
const { data } = await organization.getDomains({
|
|
300
|
+
- limit: 10,
|
|
301
|
+
+ pageSize: 10,
|
|
302
|
+
- offset: 10,
|
|
303
|
+
+ initialPage: 2,
|
|
304
|
+
})
|
|
305
|
+
```
|
|
306
|
+
</AccordionPanel>
|
|
307
|
+
<AccordionPanel>
|
|
308
|
+
There have been a couple changes to the pagination arguments that can be passed into this function - `limit` has been renamed to `pageSize`, and `offset` has been renamed to `initialPage`. This will help to make it more clear and simple to reason about pagination control. Example of how changes might look below:
|
|
309
|
+
|
|
310
|
+
```diff
|
|
311
|
+
const { data } = await organization.getInvitations({
|
|
312
|
+
- limit: 10,
|
|
313
|
+
+ pageSize: 10,
|
|
314
|
+
- offset: 10,
|
|
315
|
+
+ initialPage: 2,
|
|
316
|
+
})
|
|
317
|
+
```
|
|
318
|
+
</AccordionPanel>
|
|
319
|
+
<AccordionPanel>
|
|
320
|
+
There have been a couple changes to the pagination arguments that can be passed into this function - `limit` has been renamed to `pageSize`, and `offset` has been renamed to `initialPage`. This will help to make it more clear and simple to reason about pagination control. Example of how changes might look below:
|
|
321
|
+
|
|
322
|
+
```diff
|
|
323
|
+
const { data } = await organization.getMembershipRequests({
|
|
324
|
+
- limit: 10,
|
|
325
|
+
+ pageSize: 10,
|
|
326
|
+
- offset: 10,
|
|
327
|
+
+ initialPage: 2,
|
|
328
|
+
})
|
|
329
|
+
```
|
|
330
|
+
</AccordionPanel>
|
|
331
|
+
<AccordionPanel>
|
|
332
|
+
There have been a couple changes to the pagination arguments that can be passed into this function - `limit` has been renamed to `pageSize`, and `offset` has been renamed to `initialPage`. This will help to make it more clear and simple to reason about pagination control. Example of how changes might look below:
|
|
333
|
+
|
|
334
|
+
```diff
|
|
335
|
+
const { data } = await user.getOrganizationInvitations({
|
|
336
|
+
- limit: 10,
|
|
337
|
+
+ pageSize: 10,
|
|
338
|
+
- offset: 10,
|
|
339
|
+
+ initialPage: 2,
|
|
340
|
+
})
|
|
341
|
+
```
|
|
342
|
+
</AccordionPanel>
|
|
343
|
+
<AccordionPanel>
|
|
344
|
+
There have been a couple changes to the pagination arguments that can be passed into this function - `limit` has been renamed to `pageSize`, and `offset` has been renamed to `initialPage`. This will help to make it more clear and simple to reason about pagination control. Example of how changes might look below:
|
|
345
|
+
|
|
346
|
+
```diff
|
|
347
|
+
const { data } = await user.getOrganizationSuggestions({
|
|
348
|
+
- limit: 10,
|
|
349
|
+
+ pageSize: 10,
|
|
350
|
+
- offset: 10,
|
|
351
|
+
+ initialPage: 2,
|
|
352
|
+
})
|
|
353
|
+
```
|
|
354
|
+
</AccordionPanel>
|
|
355
|
+
<AccordionPanel>
|
|
356
|
+
There have been a couple changes to the pagination arguments that can be passed into this function - `limit` has been renamed to `pageSize`, and `offset` has been renamed to `initialPage`. This will help to make it more clear and simple to reason about pagination control. Example of how changes might look below:
|
|
357
|
+
|
|
358
|
+
```diff
|
|
359
|
+
const { data } = await user.getOrganizationMemberships({
|
|
360
|
+
- limit: 10,
|
|
361
|
+
+ pageSize: 10,
|
|
362
|
+
- offset: 10,
|
|
363
|
+
+ initialPage: 2,
|
|
364
|
+
})
|
|
365
|
+
```
|
|
366
|
+
</AccordionPanel>
|
|
367
|
+
<AccordionPanel>
|
|
368
|
+
The response payload of `Users.getOrganizationInvitationList` was changed as part of the v5 release. Rather than directly returning ` data`, the return signature is now `{ data, totalCount }`. Since backend API responses are paginated, the `totalCount` property is helpful in determining the total number of items in the response easily, and this change in the backend SDK aligns the response shape with what the backend API returns directly.
|
|
369
|
+
|
|
370
|
+
Here's an example of how the response shape would change with this modification:
|
|
371
|
+
|
|
372
|
+
```diff
|
|
373
|
+
- const data = await clerkClient.users.getOrganizationInvitationList()
|
|
374
|
+
+ const { data, totalCount } = await clerkClient.users.getOrganizationInvitationList()
|
|
375
|
+
```
|
|
376
|
+
</AccordionPanel>
|
|
377
|
+
<AccordionPanel>
|
|
378
|
+
The return type for this function was previously `[Items]` but has now been updated to `{ data: [Items], totalCount: number }`. Since Clerk's API responses are paginated, the `totalCount` property is helpful in determining the total number of items in the response easily. A before/after code example can be seen below:
|
|
379
|
+
|
|
380
|
+
```diff
|
|
381
|
+
const data = await clerkClient.organizations.getOrganizationInvitationList({
|
|
382
|
+
organizationId: "...",
|
|
383
|
+
})
|
|
384
|
+
|
|
385
|
+
- data.forEach(() => {})
|
|
386
|
+
+ data.data.forEach(() => {})
|
|
387
|
+
```
|
|
388
|
+
</AccordionPanel>
|
|
389
|
+
<AccordionPanel>
|
|
390
|
+
The return type for this function was previously `[Items]` but has now been updated to `{ data: [Items], totalCount: number }`. Since Clerk's API responses are paginated, the `totalCount` property is helpful in determining the total number of items in the response easily. A before/after code example can be seen below:
|
|
391
|
+
|
|
392
|
+
```diff
|
|
393
|
+
const { user } = useUser()
|
|
394
|
+
const membershipList = user.getOrganizationMembershipList()
|
|
395
|
+
|
|
396
|
+
- membershipList.forEach(() => {})
|
|
397
|
+
+ membershipList.data.forEach(() => {})
|
|
398
|
+
```
|
|
399
|
+
</AccordionPanel>
|
|
400
|
+
<AccordionPanel>
|
|
401
|
+
The response payload of `Users.getOrganizationList` was changed as part of the v5 release. Rather than directly returning ` data`, the return signature is now `{ data, totalCount }`. Since backend API responses are paginated, the `totalCount` property is helpful in determining the total number of items in the response easily, and this change in the backend SDK aligns the response shape with what the backend API returns directly.
|
|
402
|
+
|
|
403
|
+
Here's an example of how the response shape would change with this modification:
|
|
404
|
+
|
|
405
|
+
```diff
|
|
406
|
+
- const data = await clerkClient.users.getOrganizationList()
|
|
407
|
+
+ const { data, totalCount } = await clerkClient.users.getOrganizationList()
|
|
408
|
+
```
|
|
409
|
+
</AccordionPanel>
|
|
410
|
+
<AccordionPanel>
|
|
411
|
+
The return type for this function was previously `[Items]` but has now been updated to `{ data: [Items], totalCount: number }`. Since Clerk's API responses are paginated, the `totalCount` property is helpful in determining the total number of items in the response easily. A before/after code example can be seen below:
|
|
412
|
+
|
|
413
|
+
```diff
|
|
414
|
+
const { organization } = useOrganization()
|
|
415
|
+
const orgList = organization.getOrganizationList()
|
|
416
|
+
|
|
417
|
+
- orgList.forEach(() => {})
|
|
418
|
+
+ orgList.data.forEach(() => {})
|
|
419
|
+
```
|
|
420
|
+
</AccordionPanel>
|
|
421
|
+
<AccordionPanel>
|
|
422
|
+
Across Clerk's documentation and codebases the term "magic link" was changed to "email link" as it more accurately reflects the functionality.
|
|
423
|
+
</AccordionPanel>
|
|
424
|
+
<AccordionPanel>
|
|
425
|
+
Across Clerk's documentation and codebases the term "magic link" was changed to "email link" as it more accurately reflects functionality.
|
|
426
|
+
</AccordionPanel>
|
|
427
|
+
<AccordionPanel>
|
|
428
|
+
Across Clerk's documentation and codebases the term "magic link" was changed to "email link" as it more accurately reflects the functionality.
|
|
429
|
+
</AccordionPanel>
|
|
430
|
+
<AccordionPanel>
|
|
431
|
+
Across Clerk's documentation and codebases the term "magic link" was changed to "email link" as it more accurately reflects the functionality.
|
|
432
|
+
</AccordionPanel>
|
|
433
|
+
<AccordionPanel>
|
|
434
|
+
Across Clerk's documentation and codebases the term "magic link" was changed to "email link" as it more accurately reflects functionality.
|
|
435
|
+
</AccordionPanel>
|
|
436
|
+
<AccordionPanel>
|
|
437
|
+
`setSession` should be replaced with `setActive`. The format of the parameters has changed slightly - `setActive` takes an object where `setSession` took params directly. The `setActive` function also can accept an `organization` param that is used to set the currently active organization. The return signature did not change. Read the [API documentation](/docs/references/javascript/clerk/session-methods#set-active) for more detail. This function should be expected to be returned from one of the following Clerk hooks: `useSessionList`, `useSignUp`, or `useSignIn`. Some migration examples:
|
|
438
|
+
|
|
439
|
+
```diff
|
|
440
|
+
- await setSession('sessionID', () => void)
|
|
441
|
+
+ await setActive({ session: 'sessionID', beforeEmit: () => void })
|
|
442
|
+
|
|
443
|
+
- await setSession(sessionObj)
|
|
444
|
+
+ await setActive({ session: sessionObj })
|
|
445
|
+
|
|
446
|
+
- await setSession(sessionObj, () => void)
|
|
447
|
+
+ await setActive({ session: sessionObj, beforeEmit: () => void })
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
`setActive` also supports setting an active organization:
|
|
451
|
+
|
|
452
|
+
```js
|
|
453
|
+
await setActive({
|
|
454
|
+
session: 'sessionID',
|
|
455
|
+
organization: 'orgID',
|
|
456
|
+
beforeEmit: () => void
|
|
457
|
+
})
|
|
458
|
+
|
|
459
|
+
await setActive({
|
|
460
|
+
session: sessionObj,
|
|
461
|
+
organization: orgObj,
|
|
462
|
+
beforeEmit: () => void
|
|
463
|
+
})
|
|
464
|
+
```
|
|
465
|
+
</AccordionPanel>
|
|
466
|
+
<AccordionPanel>
|
|
467
|
+
The `invitationList` param to the `useOrganizations` hook has been replaced by `invitations`. This param also has a slightly different way of working, examples included below. Note also that `useOrganizations` is deprecated and should be updated to `useOrganization` instead.
|
|
468
|
+
|
|
469
|
+
```js
|
|
470
|
+
// before
|
|
471
|
+
const { invitationList } = useOrganization({
|
|
472
|
+
invitationList: { limit: 10, offset: 1 },
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
// after
|
|
476
|
+
const { invitations } = useOrganization({
|
|
477
|
+
invitations: {
|
|
478
|
+
initialPage: 1,
|
|
479
|
+
pageSize: 10,
|
|
480
|
+
},
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
// you can also simply return all invitations
|
|
484
|
+
const { invitations } = useOrganization({ invitations: true });
|
|
485
|
+
```
|
|
486
|
+
</AccordionPanel>
|
|
487
|
+
<AccordionPanel>
|
|
488
|
+
The `membershipList` param from the `useOrganization` hook has been removed. Instead, [use the `memberships` param](https://clerk.com/docs/references/react/use-organization#parameters). Examples of each can be seen here:
|
|
489
|
+
|
|
490
|
+
```js
|
|
491
|
+
// before
|
|
492
|
+
const { membershipList } = useOrganization({
|
|
493
|
+
membershipList: { limit: 10, offset: 1 },
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
// after
|
|
497
|
+
const { memberships } = useOrganization({
|
|
498
|
+
memberships: {
|
|
499
|
+
initialPage: 1,
|
|
500
|
+
pageSize: 10,
|
|
501
|
+
},
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
// you can also simply return all memberships
|
|
505
|
+
const { memberships } = useOrganization({ memberships: true });
|
|
506
|
+
```
|
|
507
|
+
</AccordionPanel>
|
|
508
|
+
<AccordionPanel>
|
|
509
|
+
Any place where `useOrganizations` is used should be switched to [`useOrganizationList`](https://clerk.com/docs/references/react/use-organization-list) or [`useOrganization`](https://clerk.com/docs/references/react/use-organization) instead. The return signature has also changed, so take note of this when making the upgrade.
|
|
510
|
+
|
|
511
|
+
```js
|
|
512
|
+
// before: useOrganizations return values
|
|
513
|
+
{
|
|
514
|
+
isLoaded: boolean,
|
|
515
|
+
createOrganization: clerk.createOrganization,
|
|
516
|
+
getOrganizationMemberships: clerk.getOrganizationMemberships,
|
|
517
|
+
getOrganization: clerk.getOrganization,
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
// after: useOrganizationList return values
|
|
521
|
+
{
|
|
522
|
+
isLoaded: boolean,
|
|
523
|
+
createOrganization: clerk.createOrganization,
|
|
524
|
+
userMemberships: PaginatedResourcesWithDefault<...> | PaginatedResources<...>,
|
|
525
|
+
userInvitations: PaginatedResourcesWithDefault<...> | PaginatedResources<...>,
|
|
526
|
+
userSuggestions: PaginatedResourcesWithDefault<...> | PaginatedResources<...>,
|
|
527
|
+
setActive: clerk.setActive,
|
|
528
|
+
}
|
|
529
|
+
```
|
|
530
|
+
</AccordionPanel>
|
|
531
|
+
<AccordionPanel>
|
|
532
|
+
The `userProfile` prop on [the `UserButton` component](https://clerk.com/docs/references/javascript/clerk/user-button#user-button-component) has been changed to `userProfileProps`. This is purely a name change, none of the values need to be updated.
|
|
533
|
+
|
|
534
|
+
```diff
|
|
535
|
+
- <UserButton userProfile={} />
|
|
536
|
+
+ <UserButton userProfileProps={} />
|
|
537
|
+
```
|
|
538
|
+
</AccordionPanel>
|
|
539
|
+
<AccordionPanel>
|
|
540
|
+
The `WithSession` higher order component has been removed. If you would still like to use this function in the way its implemented, it can be created quickly using Clerk's [custom hooks](https://clerk.com/docs/references/react/overview). An example of how to do so is below:
|
|
541
|
+
|
|
542
|
+
```js
|
|
543
|
+
export const WithSession = ({ children }) => {
|
|
544
|
+
const session = useSession();
|
|
545
|
+
if (typeof children !== 'function') throw new Error();
|
|
546
|
+
|
|
547
|
+
return {children(session)};
|
|
548
|
+
};
|
|
549
|
+
```
|
|
550
|
+
</AccordionPanel>
|
|
551
|
+
<AccordionPanel>
|
|
552
|
+
The `WithClerk` higher order component has been removed. If you would still like to use this function in the way its implemented, it can be created quickly using Clerk's [custom hooks](https://clerk.com/docs/references/react/overview). An example of how to do so is below:
|
|
553
|
+
|
|
554
|
+
```js
|
|
555
|
+
export const WithClerk = ({ children }) => {
|
|
556
|
+
const clerk = useClerk();
|
|
557
|
+
if (typeof children !== 'function') throw new Error();
|
|
558
|
+
|
|
559
|
+
return {children(clerk)};
|
|
560
|
+
};
|
|
561
|
+
```
|
|
562
|
+
</AccordionPanel>
|
|
563
|
+
<AccordionPanel>
|
|
564
|
+
The `WithUser` higher order component has been removed. If you would still like to use this function in the way its implemented, it can be created quickly using Clerk's [custom hooks](https://clerk.com/docs/references/react/overview). An example of how to do so is below:
|
|
565
|
+
|
|
566
|
+
```js
|
|
567
|
+
export const WithUser = ({ children }) => {
|
|
568
|
+
const user = useUser();
|
|
569
|
+
if (typeof children !== 'function') throw new Error();
|
|
570
|
+
|
|
571
|
+
return {children(user)};
|
|
572
|
+
};
|
|
573
|
+
```
|
|
574
|
+
</AccordionPanel>
|
|
575
|
+
<AccordionPanel>
|
|
576
|
+
The `withClerk` higher order function has been removed. If you would still like to use this function in the way its implemented, it can be created quickly using Clerk's [custom hooks](https://clerk.com/docs/references/react/overview). An example of how to do so is below:
|
|
577
|
+
|
|
578
|
+
```js
|
|
579
|
+
function withClerk(Component, displayName) {
|
|
580
|
+
displayName = displayName || Component.displayName || Component.name || 'Component';
|
|
581
|
+
Component.displayName = displayName;
|
|
582
|
+
const HOC = props => {
|
|
583
|
+
const clerk = useIsomorphicClerkContext();
|
|
584
|
+
|
|
585
|
+
if (!clerk.loaded) return null;
|
|
586
|
+
|
|
587
|
+
return (
|
|
588
|
+
<Component
|
|
589
|
+
{...props}
|
|
590
|
+
clerk={clerk}
|
|
591
|
+
/>
|
|
592
|
+
);
|
|
593
|
+
};
|
|
594
|
+
|
|
595
|
+
HOC.displayName = `withClerk(${displayName})`;
|
|
596
|
+
return HOC;
|
|
597
|
+
}
|
|
598
|
+
```
|
|
599
|
+
</AccordionPanel>
|
|
600
|
+
<AccordionPanel>
|
|
601
|
+
The `withSession` higher order function has been removed. If you would still like to use this function in the way its implemented, it can be created quickly using Clerk's [custom hooks](https://clerk.com/docs/references/react/overview). An example of how to do so is below:
|
|
602
|
+
|
|
603
|
+
```js
|
|
604
|
+
function withSession(Component, displayName) {
|
|
605
|
+
displayName = displayName || Component.displayName || Component.name || 'Component';
|
|
606
|
+
Component.displayName = displayName;
|
|
607
|
+
const HOC = props => {
|
|
608
|
+
const session = useSessionContext();
|
|
609
|
+
|
|
610
|
+
if (!session) return null;
|
|
611
|
+
|
|
612
|
+
return (
|
|
613
|
+
<Component
|
|
614
|
+
{...props}
|
|
615
|
+
session={session}
|
|
616
|
+
/>
|
|
617
|
+
);
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
HOC.displayName = `withSession(${displayName})`;
|
|
621
|
+
return HOC;
|
|
622
|
+
}
|
|
623
|
+
```
|
|
624
|
+
</AccordionPanel>
|
|
625
|
+
<AccordionPanel>
|
|
626
|
+
The `withUser` higher order function has been removed. If you would still like to use this function in the way its implemented, it can be created quickly using Clerk's [custom hooks](https://clerk.com/docs/references/react/overview). An example of how to do so is below:
|
|
627
|
+
|
|
628
|
+
```js
|
|
629
|
+
function withUser(Component, displayName) {
|
|
630
|
+
displayName = displayName || Component.displayName || Component.name || 'Component';
|
|
631
|
+
Component.displayName = displayName;
|
|
632
|
+
const HOC = props => {
|
|
633
|
+
const clerk = useUserContext();
|
|
634
|
+
|
|
635
|
+
if (!user) return null;
|
|
636
|
+
|
|
637
|
+
return (
|
|
638
|
+
<Component
|
|
639
|
+
{...props}
|
|
640
|
+
user={user}
|
|
641
|
+
/>
|
|
642
|
+
);
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
HOC.displayName = `withUser(${displayName})`;
|
|
646
|
+
return HOC;
|
|
647
|
+
}
|
|
648
|
+
```
|
|
649
|
+
</AccordionPanel>
|
|
650
|
+
<AccordionPanel>
|
|
651
|
+
`MultiSessionAppSupport` is a component that handles the intermediate “undefined” state for multisession apps by unmounting and remounting the components during the session switch (`setActive` call) in order to solve theoretical edge-cases that can arise while switching sessions. It is undocumented and intended only for internal use, so it has been moved to an `/internal` import path. Please note that internal imports are not intended for public use, and are outside the scope of semver.
|
|
652
|
+
|
|
653
|
+
```diff
|
|
654
|
+
- import { MultiSessionAppSupport } from '@clerk/clerk-react'
|
|
655
|
+
+ import { MultiSessionAppSupport } from '@clerk/clerk-react/internal'
|
|
656
|
+
```
|
|
657
|
+
</AccordionPanel>
|
|
658
|
+
<AccordionPanel>
|
|
659
|
+
The `signOutCallback` prop on the [`<SignOutButton />` component](https://clerk.com/docs/components/unstyled/sign-out-button) has been removed. Instead, you can use the `redirectUrl` prop. Example below:
|
|
660
|
+
|
|
661
|
+
```diff
|
|
662
|
+
import { SignOutButton } from "@clerk/clerk-react";
|
|
663
|
+
|
|
664
|
+
export const Signout = () => {
|
|
665
|
+
return (
|
|
666
|
+
<SignOutButton
|
|
667
|
+
- signOutCallback={() => { window.location.href = "/your-path" }}
|
|
668
|
+
+ redirectUrl="/your-path"
|
|
669
|
+
>
|
|
670
|
+
<button>Sign Out</button>
|
|
671
|
+
</SignOutButton>
|
|
672
|
+
)
|
|
673
|
+
}
|
|
674
|
+
```
|
|
675
|
+
</AccordionPanel>
|
|
676
|
+
</Accordion>
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
|