@clerk/upgrade 0.2.1 → 0.4.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/constants/sdks.js +4 -5
- package/dist/guide-generators/core-2/backend/import-paths.mdx +3 -0
- package/dist/guide-generators/core-2/backend/index.js +22 -0
- package/dist/guide-generators/core-2/backend/intro.mdx +3 -0
- package/dist/guide-generators/core-2/chrome-extension/index.js +24 -0
- package/dist/guide-generators/core-2/chrome-extension/intro.mdx +3 -0
- package/dist/guide-generators/core-2/expo/index.js +25 -0
- package/dist/guide-generators/core-2/expo/intro.mdx +3 -0
- package/dist/guide-generators/core-2/fastify/index.js +23 -0
- package/dist/guide-generators/core-2/fastify/intro.mdx +3 -0
- package/dist/guide-generators/core-2/gatsby/index.js +25 -0
- package/dist/guide-generators/core-2/gatsby/intro.mdx +3 -0
- package/dist/guide-generators/core-2/generate-all.sh +16 -0
- package/dist/guide-generators/core-2/js/index.js +28 -0
- package/dist/guide-generators/core-2/js/intro.mdx +3 -0
- package/dist/guide-generators/core-2/nextjs/import-changes.mdx +98 -0
- package/dist/guide-generators/core-2/nextjs/index.js +25 -0
- package/dist/guide-generators/core-2/nextjs/intro.mdx +3 -0
- package/dist/guide-generators/core-2/nextjs/middleware-changes.mdx +229 -0
- package/dist/guide-generators/core-2/nextjs/nextjs-version.mdx +6 -0
- package/dist/guide-generators/core-2/node/index.js +23 -0
- package/dist/guide-generators/core-2/node/intro.mdx +3 -0
- package/dist/guide-generators/core-2/node/node-setters-removals.mdx +34 -0
- package/dist/guide-generators/core-2/overview/index.js +12 -0
- package/dist/guide-generators/core-2/overview/intro.mdx +25 -0
- package/dist/guide-generators/core-2/react/hof-removals.mdx +3 -0
- package/dist/guide-generators/core-2/react/index.js +25 -0
- package/dist/guide-generators/core-2/react/intro.mdx +3 -0
- package/dist/guide-generators/core-2/remix/index.js +25 -0
- package/dist/guide-generators/core-2/remix/intro.mdx +3 -0
- package/dist/guide-generators/core-2/retheme/index.js +23 -0
- package/dist/guide-generators/core-2/retheme/intro.mdx +9 -0
- package/dist/guide-generators/core-2/shared/after-sign-x-handling.mdx +10 -0
- package/dist/guide-generators/core-2/shared/cli.mdx +22 -0
- package/dist/guide-generators/core-2/shared/deprecation-removals.mdx +6 -0
- package/dist/guide-generators/core-2/shared/image-url.mdx +3 -0
- package/dist/guide-generators/core-2/shared/node-version.mdx +3 -0
- package/dist/guide-generators/core-2/shared/orgs-claim.mdx +50 -0
- package/dist/guide-generators/core-2/shared/pagination-args.mdx +3 -0
- package/dist/guide-generators/core-2/shared/pagination-return.mdx +3 -0
- package/dist/guide-generators/core-2/shared/path-routing.mdx +57 -0
- package/dist/guide-generators/core-2/shared/prepare.mdx +10 -0
- package/dist/guide-generators/core-2/shared/react-version.mdx +20 -0
- package/dist/guide-generators/core-2/shared/redesign-preview.mdx +5 -0
- package/dist/guide-generators/core-2/shared/update-version.mdx +18 -0
- package/dist/guide-generators/text-generation.js +109 -0
- package/dist/util/load-change.js +3 -2
- package/dist/versions/{v5 → core-2}/backend/authenticaterequest-params-change.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/clockskewinseconds.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/constants-import-path-move.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/createauthenticaterequest-import-path-move.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/createclerkclient-apikey.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/createclerkclient-frontendapi.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/createisomorphicrequest-import-path-move.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/createisomorphicrequest-removed.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/decodejwt-import-path-move.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/getorganizationmembershiplist-return-signature.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/httpoptions-removed.md +2 -1
- package/dist/versions/{v5 → core-2}/backend/organizationjson-logourl.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/organizationmembershippublicuserdatajson-profileimageurl.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/redirect-import-path-move.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/signjwt-import-path-move.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/signjwterror-import-move.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/tokenverificationerror-import-move.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/tokenverificationerroraction-import-move.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/tokenverificationerrorcode-import-move.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/tokenverificationerrorreason-import-move.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/userjson-profileimageurl.md +1 -0
- package/dist/versions/{v5 → core-2}/backend/verifyjwt-import-path-move.md +1 -0
- package/dist/versions/{v5/chromeExtension → core-2/chrome-extension}/clerkprovider-tokencache.md +8 -10
- package/dist/versions/{v5 → core-2}/common/afterswitchorganizationurl.md +1 -0
- package/dist/versions/{v5 → core-2}/common/alternativemethods-backlink.md +1 -0
- package/dist/versions/{v5 → core-2}/common/api-key-to-secret-key.md +1 -0
- package/dist/versions/{v5 → core-2}/common/appearance-organizationpreview-organizationswitcher.md +1 -0
- package/dist/versions/core-2/common/appearance-variables-breaking-changes.md +15 -0
- package/dist/versions/{v5 → core-2}/common/button-to-organizationlistcreateorganizationactionbutton.md +1 -0
- package/dist/versions/{v5 → core-2}/common/card-changes.md +3 -2
- package/dist/versions/core-2/common/changed-localization-keys.md +180 -0
- package/dist/versions/{v5 → core-2}/common/clerkprovider-frontendapi-2.md +1 -0
- package/dist/versions/{v5 → core-2}/common/clerkprovideroptionswrapper-dropped.md +1 -0
- package/dist/versions/{v5 → core-2}/common/connected-accounts-dropdown.md +1 -0
- package/dist/versions/{v5 → core-2}/common/emaillinkerrorcode-import-change.md +1 -0
- package/dist/versions/{v5/js/external-account-avatarurl.md → core-2/common/externalaccount-avatarurl.md} +2 -2
- package/dist/versions/{v5/backend → core-2/common}/externalaccount-picture.md +1 -0
- package/dist/versions/{v5/backend → core-2/common}/externalaccountjson-avatarurl.md +1 -0
- package/dist/versions/{v5 → core-2}/common/frontend-api-to-publishable-key.md +1 -0
- package/dist/versions/{v5/backend → core-2/common}/getorganizationinvitationlist-return-signature.md +1 -0
- package/dist/versions/{v5 → core-2}/common/getorganizationinvitationlist-return-type-change.md +8 -5
- package/dist/versions/{v5/backend → core-2/common}/getorganizationlist-return-signature.md +1 -0
- package/dist/versions/{v5 → core-2}/common/getorganizationlist-return-type-change.md +2 -1
- package/dist/versions/{v5 → core-2}/common/getorganizationmembershiplist-return-type-change.md +2 -1
- package/dist/versions/{v5 → core-2}/common/isclerkapiresponserror-import-change.md +1 -0
- package/dist/versions/{v5 → core-2}/common/isemaillinkerror-import-change.md +1 -0
- package/dist/versions/{v5 → core-2}/common/isknownerror-import-change.md +1 -0
- package/dist/versions/core-2/common/ismetamaskerror-import-change.md +14 -0
- package/dist/versions/{v5 → core-2}/common/mfa-dropdown.md +1 -0
- package/dist/versions/{v5 → core-2}/common/min-react-version.md +2 -0
- package/dist/versions/{v5 → core-2}/common/multisessionappsupport-import-change.md +1 -1
- package/dist/versions/{v5 → core-2}/common/navigate-to-routerpush-routerreplace.md +1 -0
- package/dist/versions/core-2/common/new-localization-keys.md +115 -0
- package/dist/versions/{v5/js → core-2/common}/organization-getdomains-arguments-change.md +1 -0
- package/dist/versions/{v5/js → core-2/common}/organization-getinvitations-arguments-changed.md +1 -0
- package/dist/versions/{v5/js → core-2/common}/organization-getmembershiprequests-arguments-changed.md +1 -0
- package/dist/versions/{v5 → core-2}/common/organization-getmemberships-arguments-changed.md +1 -0
- package/dist/versions/{v5 → core-2}/common/organization-getroles-arguments-changed.md +1 -0
- package/dist/versions/{v5/js → core-2/common}/organization-logourl.md +1 -0
- package/dist/versions/{v5/backend → core-2/common}/organizationmembershippublicuserdata-profileimageurl.md +1 -0
- package/dist/versions/{v5 → core-2}/common/organizationprofile-settings.md +1 -0
- package/dist/versions/{v5 → core-2}/common/organizationswitcherpopoveractionbuttontext-removed.md +1 -0
- package/dist/versions/{v5 → core-2}/common/remove-identitypreview-avatar.md +1 -0
- package/dist/versions/{v5 → core-2}/common/remove-socialbuttonsblockbuttonarrow.md +1 -0
- package/dist/versions/core-2/common/removed-localization-keys.md +191 -0
- package/dist/versions/{v5 → core-2}/common/useorganization-invitationlist.md +5 -5
- package/dist/versions/{v5 → core-2}/common/useorganization-membershiplist.md +5 -5
- package/dist/versions/{v5/common/user-getorganizationinvitations-arguments-chanaged.md → core-2/common/user-getorganizationinvitations-arguments-changed.md} +1 -0
- package/dist/versions/{v5/common/user-getorganizationmemberships-arguments-chanaged.md → core-2/common/user-getorganizationmemberships-arguments-changed.md} +1 -0
- package/dist/versions/{v5/common/user-getorganizationsuggestions-arguments-chanaged.md → core-2/common/user-getorganizationsuggestions-arguments-changed.md} +1 -0
- package/dist/versions/{v5/backend → core-2/common}/user-profileimageurl.md +1 -0
- package/dist/versions/{v5/js → core-2/common}/user-update-password.md +8 -9
- package/dist/versions/{v5 → core-2}/common/userbuttonpopoveractionbuttontext-removed.md +1 -0
- package/dist/versions/core-2/common/userbuttontrigger-userbuttonbox-invert.md +13 -0
- package/dist/versions/{v5 → core-2}/common/userprofile-security.md +1 -0
- package/dist/versions/{v5 → core-2}/common/withclerk-hof-removed.md +15 -14
- package/dist/versions/{v5 → core-2}/common/withclerk-removed.md +1 -0
- package/dist/versions/{v5 → core-2}/common/withsession-hof-removed.md +15 -14
- package/dist/versions/{v5 → core-2}/common/withsession-removed.md +1 -0
- package/dist/versions/{v5 → core-2}/common/withuser-hof-removed.md +15 -14
- package/dist/versions/{v5 → core-2}/common/withuser-removed-2.md +1 -2
- package/dist/versions/{v5 → core-2}/expo/apikey-to-publishable-key.md +1 -0
- package/dist/versions/{v5 → core-2}/expo/clerkprovider-frontendapi.md +1 -0
- package/dist/versions/{v5 → core-2}/fastify/clerkplugin-frontendapi.md +2 -1
- package/dist/versions/{v5 → core-2}/fastify/createclerkclient-apikey.md +1 -0
- package/dist/versions/{v5 → core-2}/fastify/createclerkclient-frontendapi.md +1 -0
- package/dist/versions/core-2/gatsby/api-url-value-change.md +8 -0
- package/dist/versions/{v5 → core-2}/gatsby/apikey-to-publishable-key.md +1 -0
- package/dist/versions/{v5 → core-2}/gatsby/createclerkclient-apikey.md +1 -0
- package/dist/versions/{v5 → core-2}/gatsby/createclerkclient-frontendapi.md +1 -0
- package/dist/versions/core-2/gatsby/withserverauth-return-type.md +35 -0
- package/dist/versions/core-2/index.js +34 -0
- package/dist/versions/{v5 → core-2}/js/experimental-canusecaptcha.md +1 -0
- package/dist/versions/{v5 → core-2}/js/experimental-captchasitekey.md +1 -0
- package/dist/versions/{v5 → core-2}/js/experimental-captchaurl.md +1 -0
- package/dist/versions/{v5 → core-2}/js/getorganizationmemberships.md +3 -6
- package/dist/versions/core-2/js/redirecttohome.md +13 -0
- package/dist/versions/{v5 → core-2}/js/signup-attemptweb3walletverification-generatedsignature.md +3 -2
- package/dist/versions/{v5 → core-2}/js/unstable-invitationupdate.md +1 -0
- package/dist/versions/{v5 → core-2}/js/unstable-membershipupdate.md +1 -0
- package/dist/versions/{v5 → core-2}/js/user-createexternalaccount-redirecturl.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/auth-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/auth-middleware-deprecated.md +8 -7
- package/dist/versions/{v5/next → core-2/nextjs}/authmiddleware-apikey.md +5 -7
- package/dist/versions/{v5/next → core-2/nextjs}/authmiddleware-frontendapi.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/authmiddleware-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/buildclerkprops-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/clerk-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/clerk-js-version-next-public.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/constants-import-change.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/createauthenticaterequest-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/createclerkclient-apikey.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/createclerkclient-frontendapi.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/createisomorphicrequest-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/currentuser-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/decodejwt-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/emaillinkerrorcode-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/getauth-apikey.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/import-api-url.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/import-api-version.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/import-clerk-js-url.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/import-clerk-js-version.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/import-domain.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/import-is-satellite.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/import-nextjs-api.md +7 -6
- package/dist/versions/{v5/next → core-2/nextjs}/import-nextjs-app-beta.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/import-nextjs-edge-middleware.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/import-nextjs-edge-middlewarefiles.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/import-nextjs-ssr.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/import-proxy-url.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/import-publishable-key.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/import-secret-key.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/import-sign-in-url.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/import-sign-up-url.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/isclerkapiresponserror-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/isemaillinkerror-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/isknownerror-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/min-nextjs-version.md +2 -0
- package/dist/versions/{v5/next → core-2/nextjs}/multisessionappsupport-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/next-public-clerk-js-url.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/redirect-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/redirecttosignin-import-path.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/redirecttosignup-import-path.md +2 -1
- package/dist/versions/{v5/next → core-2/nextjs}/signjwt-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/verifyjwt-import-change.md +1 -0
- package/dist/versions/{v5/next → core-2/nextjs}/verifytoken-import-change.md +1 -0
- package/dist/versions/core-2/nextjs/with-clerk-middleware-removed.md +56 -0
- package/dist/versions/{v5 → core-2}/node/cjs-esm-instance.md +1 -0
- package/dist/versions/{v5 → core-2}/node/clerkexpressrequireauth-apikey.md +1 -0
- package/dist/versions/{v5 → core-2}/node/clerkexpressrequireauth-frontendapi.md +1 -0
- package/dist/versions/{v5 → core-2}/node/clerkexpresswithauth-apikey.md +1 -0
- package/dist/versions/{v5 → core-2}/node/clerkexpresswithauth-frontendapi.md +1 -0
- package/dist/versions/{v5 → core-2}/node/createclerkclient-apikey.md +1 -0
- package/dist/versions/{v5 → core-2}/node/createclerkclient-frontendapi.md +1 -0
- package/dist/versions/{v5 → core-2}/node/createclerkexpressrequireauth-apikey.md +1 -0
- package/dist/versions/{v5 → core-2}/node/createclerkexpressrequireauth-frontendapi.md +1 -0
- package/dist/versions/{v5 → core-2}/node/createclerkexpresswithauth-apikey.md +1 -0
- package/dist/versions/{v5 → core-2}/node/createclerkexpresswithauth-frontendapi.md +1 -0
- package/dist/versions/{v5 → core-2}/node/legacyauthobject-removed.md +3 -3
- package/dist/versions/{v5 → core-2}/node/setclerkapikey.md +1 -0
- package/dist/versions/{v5 → core-2}/node/setclerkapiversion.md +1 -0
- package/dist/versions/{v5 → core-2}/node/setclerkhttpoptions.md +1 -0
- package/dist/versions/{v5 → core-2}/node/setclerkserverapiurl.md +1 -0
- package/dist/versions/core-2/react/api-url-value-change.md +8 -0
- package/dist/versions/{v5 → core-2}/remix/clerk-import-change.md +1 -0
- package/dist/versions/{v5 → core-2}/remix/clerkerrorboundary-removed.md +1 -0
- package/dist/versions/{v5 → core-2}/remix/createclerkclient-apikey.md +1 -0
- package/dist/versions/{v5 → core-2}/remix/getauth-apikey.md +1 -0
- package/dist/versions/{v5 → core-2}/remix/rootauthloader-apikey.md +1 -0
- package/dist/versions/{v5 → core-2}/remix/rootauthloader-frontendapi.md +1 -0
- package/dist/versions/{v5 → core-2}/shared/useorganizationlist-organizationlist.md +2 -2
- package/package.json +2 -1
- package/dist/util/generate-export-change.js +0 -7
- package/dist/util/step-sequencer.js +0 -31
- package/dist/versions/v5/backend/clerkoptions-type.md +0 -0
- package/dist/versions/v5/backend/organization-logourl.md +0 -6
- package/dist/versions/v5/common/aftersigninurl-behavior-change-2.md +0 -7
- package/dist/versions/v5/common/aftersignouturl-behavior-change.md +0 -7
- package/dist/versions/v5/common/aftersignupurl-behavior-change.md +0 -7
- package/dist/versions/v5/common/changed-localization-keys.md +0 -179
- package/dist/versions/v5/common/getroles-pagination.md +0 -15
- package/dist/versions/v5/common/ismetamaskerror-import-change.md +0 -13
- package/dist/versions/v5/common/new-localization-keys.md +0 -133
- package/dist/versions/v5/common/organization-getdomains-arguments-change.md +0 -15
- package/dist/versions/v5/common/organization-getinvitations-arguments-changed.md +0 -15
- package/dist/versions/v5/common/organization-getmembershiprequests-arguments-changed.md +0 -15
- package/dist/versions/v5/common/removed-localization-keys.md +0 -166
- package/dist/versions/v5/common/userbuttontrigger-userbuttonbox-invert.md +0 -12
- package/dist/versions/v5/gatsby/api-url-value-change.md +0 -8
- package/dist/versions/v5/gatsby/withserverauth-return-type.md +0 -43
- package/dist/versions/v5/index.js +0 -44
- package/dist/versions/v5/js/organization-getmemberships-arguments-changed.md +0 -15
- package/dist/versions/v5/js/organization-getroles-arguments-changed.md +0 -15
- package/dist/versions/v5/js/redirecttohome.md +0 -13
- package/dist/versions/v5/js/router-navigate-push-replace.md +0 -18
- package/dist/versions/v5/js/user-getorganizationinvitations-arguments-chanaged.md +0 -15
- package/dist/versions/v5/js/user-getorganizationmemberships-arguments-chanaged.md +0 -15
- package/dist/versions/v5/js/user-getorganizationsuggestions-arguments-chanaged.md +0 -15
- package/dist/versions/v5/next/ismetamaskerror-import-change.md +0 -13
- package/dist/versions/v5/next/redirecttosignin-removed.md +0 -6
- package/dist/versions/v5/next/redirecttosignup-removed.md +0 -6
- package/dist/versions/v5/next/with-clerk-middleware-removed.md +0 -10
- package/dist/versions/v5/react/api-url-value-change.md +0 -8
- package/dist/versions/v5/react/router-navigate.md +0 -18
- /package/dist/versions/{v5 → core-2}/backend/api-url-value-changed.md +0 -0
- /package/dist/versions/{v5 → core-2}/backend/buildrequesturl-removed.md +0 -0
- /package/dist/versions/{v5 → core-2}/backend/clerk-import.md +0 -0
- /package/dist/versions/{v5 → core-2}/backend/client-unstableoptions-removed.md +0 -0
- /package/dist/versions/{v5 → core-2}/backend/createemail-removed.md +0 -0
- /package/dist/versions/{v5 → core-2}/backend/getpendingorganizationinvitationlist.md +0 -0
- /package/dist/versions/{v5 → core-2}/backend/membershiprole.md +0 -0
- /package/dist/versions/{v5 → core-2}/backend/pkgversion.md +0 -0
- /package/dist/versions/{v5 → core-2}/common/handlemagiclinkverification.md +0 -0
- /package/dist/versions/{v5 → core-2}/common/ismagiclinkerror.md +0 -0
- /package/dist/versions/{v5 → core-2}/common/magiclinkerror.md +0 -0
- /package/dist/versions/{v5 → core-2}/common/magiclinkerrorcode.md +0 -0
- /package/dist/versions/{v5/js → core-2/common}/organization-create-string.md +0 -0
- /package/dist/versions/{v5/js → core-2/common}/organization-getpendinginvitations.md +0 -0
- /package/dist/versions/{v5 → core-2}/common/setsession.md +0 -0
- /package/dist/versions/{v5 → core-2}/common/signoutcallback-to-redirecturl.md +0 -0
- /package/dist/versions/{v5 → core-2}/common/usemagiclink.md +0 -0
- /package/dist/versions/{v5 → core-2}/common/useorganizations.md +0 -0
- /package/dist/versions/{v5 → core-2}/common/userprofile-prop.md +0 -0
- /package/dist/versions/{v5 → core-2}/fastify/api-url-value-change.md +0 -0
- /package/dist/versions/{v5 → core-2}/fastify/clerk-import-change.md +0 -0
- /package/dist/versions/{v5 → core-2}/gatsby/clerk-import-change.md +0 -0
- /package/dist/versions/{v5 → core-2}/js/clerk-isready-removed.md +0 -0
- /package/dist/versions/{v5 → core-2}/js/lastorganizationinvitation-member.md +0 -0
- /package/dist/versions/{v5 → core-2}/js/user-orgpublicdata-profileimageurl.md +0 -0
- /package/dist/versions/{v5/next → core-2/nextjs}/api-url-value-change.md +0 -0
- /package/dist/versions/{v5 → core-2}/node/api-url-value-change.md +0 -0
- /package/dist/versions/{v5 → core-2}/node/clerk-import-change.md +0 -0
- /package/dist/versions/{v5 → core-2}/shared/getrequesturl.md +0 -0
- /package/dist/versions/{v5 → core-2}/shared/organizationcontext.md +0 -0
package/dist/constants/sdks.js
CHANGED
|
@@ -4,10 +4,9 @@ export default [{
|
|
|
4
4
|
}, {
|
|
5
5
|
label: '@clerk/remix',
|
|
6
6
|
value: 'remix'
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, {
|
|
7
|
+
},
|
|
8
|
+
// { label: 'gatsby-plugin-clerk', value: 'gatsby' },
|
|
9
|
+
{
|
|
11
10
|
label: '@clerk/redwood',
|
|
12
11
|
value: 'redwood'
|
|
13
12
|
}, {
|
|
@@ -42,5 +41,5 @@ export default [{
|
|
|
42
41
|
value: 'types'
|
|
43
42
|
}, {
|
|
44
43
|
label: '@clerk/chrome-extension',
|
|
45
|
-
value: '
|
|
44
|
+
value: 'chrome-extension'
|
|
46
45
|
}];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
### Import paths changes
|
|
2
|
+
|
|
3
|
+
Some top level import paths have been changed in order to improve tree-shaking and more clearly categorize sets of functionality. Some methods have been moved under an `/internal` path, indicating that they are only intended for internal use, are exempt from semver, and should be used with great caution.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, singleItem, writeToFile } from '../../text-generation.js';
|
|
2
|
+
const version = 'core-2';
|
|
3
|
+
const name = 'backend';
|
|
4
|
+
const properName = 'Backend';
|
|
5
|
+
const packageName = '@clerk/backend';
|
|
6
|
+
const cwd = `${version}/${name}`;
|
|
7
|
+
async function generate() {
|
|
8
|
+
const data = await loadVersionChangeData(version, name);
|
|
9
|
+
return assembleContent({
|
|
10
|
+
data,
|
|
11
|
+
cwd
|
|
12
|
+
}, [frontmatter({
|
|
13
|
+
title: `Upgrading ${properName} to Core 2`,
|
|
14
|
+
description: `Learn how to upgrade Clerk's ${properName} SDK to the latest version.`
|
|
15
|
+
}), `# Upgrading \`${packageName}\` to Core 2`, markdown('intro'), markdownTemplate('prepare', {
|
|
16
|
+
version: 'v1',
|
|
17
|
+
packageName
|
|
18
|
+
}), markdown('node-version'), markdownTemplate('update-version', {
|
|
19
|
+
packageName
|
|
20
|
+
}), markdown('cli'), '## Breaking Changes', singleItem('authenticaterequest-params-change'), singleItem('clockskewinseconds'), markdown('import-paths'), accordionForCategory('import-paths'), singleItem('httpoptions-removed'), markdown('orgs-claim'), markdown('pagination-args'), accordionForCategory('pagination-args'), markdown('pagination-return'), accordionForCategory('pagination-return'), markdown('image-url'), accordionForCategory(['image-url', 'image-url-backend']), deprecationRemovalsAndHousekeeping()]);
|
|
21
|
+
}
|
|
22
|
+
generate().then(writeToFile(cwd));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Core 2 is included in the Backend SDK starting with version 1. This new version ships with a variety of smaller DX improvements and housekeeping items. Each of the potentially breaking changes are detailed in this guide, below.
|
|
2
|
+
|
|
3
|
+
By the end of this guide, you’ll have successfully upgraded your Backend project to use `@clerk/backend` v1. You’ll learn how to update your dependencies, resolve breaking changes, and find deprecations. Step-by-step instructions will lead you through the process.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, singleItem, writeToFile } from '../../text-generation.js';
|
|
2
|
+
const version = 'core-2';
|
|
3
|
+
const name = 'chrome-extension';
|
|
4
|
+
const properName = 'Chrome Extension';
|
|
5
|
+
const packageName = '@clerk/chrome-extension';
|
|
6
|
+
const cwd = `${version}/${name}`;
|
|
7
|
+
async function generate() {
|
|
8
|
+
const data = await loadVersionChangeData(version, name);
|
|
9
|
+
return assembleContent({
|
|
10
|
+
data,
|
|
11
|
+
cwd
|
|
12
|
+
}, [frontmatter({
|
|
13
|
+
title: `Upgrading ${properName} SDK to Core 2`,
|
|
14
|
+
description: `Learn how to upgrade Clerk's ${properName} SDK to the latest version.`
|
|
15
|
+
}), `# Upgrading \`${packageName}\` to Core 2`, markdown('intro'), markdownTemplate('prepare', {
|
|
16
|
+
version: 'v1',
|
|
17
|
+
packageName
|
|
18
|
+
}), markdown('node-version'), markdown('react-version'), markdownTemplate('update-version', {
|
|
19
|
+
packageName
|
|
20
|
+
}), markdown('cli'), '## Breaking Changes', singleItem('clerkprovider-tokencache'), markdown('redesign-preview'), markdown('after-sign-x-handling'), markdown('orgs-claim'), markdownTemplate('path-routing', {
|
|
21
|
+
packageName
|
|
22
|
+
}), markdown('image-url'), accordionForCategory('image-url'), deprecationRemovalsAndHousekeeping(['hof-removal', 'pagination-return', 'pagination-args', 'error-imports'])]);
|
|
23
|
+
}
|
|
24
|
+
generate().then(writeToFile(cwd));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Core 2 is included in the Chrome Extension SDK starting with version 1. 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.
|
|
2
|
+
|
|
3
|
+
By the end of this guide, you’ll have successfully upgraded your project to use `@clerk/chrome-extension` v1. You’ll learn how to update your dependencies, resolve breaking changes, and find deprecations. Step-by-step instructions will lead you through the process.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, writeToFile } from '../../text-generation.js';
|
|
2
|
+
const version = 'core-2';
|
|
3
|
+
const semverVersion = 'v1';
|
|
4
|
+
const name = 'expo';
|
|
5
|
+
const properName = 'Expo';
|
|
6
|
+
const packageName = '@clerk/clerk-expo';
|
|
7
|
+
const cwd = `${version}/${name}`;
|
|
8
|
+
async function generate() {
|
|
9
|
+
const data = await loadVersionChangeData(version, name);
|
|
10
|
+
return assembleContent({
|
|
11
|
+
data,
|
|
12
|
+
cwd
|
|
13
|
+
}, [frontmatter({
|
|
14
|
+
title: `Upgrading ${properName} to Core 2`,
|
|
15
|
+
description: `Learn how to upgrade Clerk's ${properName} SDK to the latest version.`
|
|
16
|
+
}), `# Upgrading \`${packageName}\` to Core 2`, markdown('intro'), markdownTemplate('prepare', {
|
|
17
|
+
version: semverVersion,
|
|
18
|
+
packageName
|
|
19
|
+
}), markdown('node-version'), markdown('react-version'), markdownTemplate('update-version', {
|
|
20
|
+
packageName
|
|
21
|
+
}), markdown('cli'), '## Breaking Changes', markdown('redesign-preview'), markdown('after-sign-x-handling'), markdown('orgs-claim'), markdownTemplate('path-routing', {
|
|
22
|
+
packageName
|
|
23
|
+
}), markdown('image-url'), accordionForCategory('image-url'), deprecationRemovalsAndHousekeeping(['hof-removal', 'pagination-return', 'pagination-args', 'error-imports'])]);
|
|
24
|
+
}
|
|
25
|
+
generate().then(writeToFile(cwd));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Core 2 is included in the Expo SDK starting with version 1. This release ships with an improved design and UX for its built-in components and a variety of smaller DX improvements and housekeeping items. Each of the potentially breaking changes are detailed in this guide, below.
|
|
2
|
+
|
|
3
|
+
By the end of this guide, you’ll have successfully upgraded your Expo project to use `@clerk/clerk-expo` v1. You’ll learn how to update your dependencies, resolve breaking changes, and find deprecations. Step-by-step instructions will lead you through the process.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, writeToFile } from '../../text-generation.js';
|
|
2
|
+
const version = 'core-2';
|
|
3
|
+
const semverVersion = 'v1';
|
|
4
|
+
const name = 'fastify';
|
|
5
|
+
const properName = 'Fastify';
|
|
6
|
+
const packageName = '@clerk/fastify';
|
|
7
|
+
const cwd = `${version}/${name}`;
|
|
8
|
+
async function generate() {
|
|
9
|
+
const data = await loadVersionChangeData(version, name);
|
|
10
|
+
return assembleContent({
|
|
11
|
+
data,
|
|
12
|
+
cwd
|
|
13
|
+
}, [frontmatter({
|
|
14
|
+
title: `Upgrading ${properName} to Core 2`,
|
|
15
|
+
description: `Learn how to upgrade Clerk's ${properName} SDK to the latest version.`
|
|
16
|
+
}), `# Upgrading \`${packageName}\` to Core 2`, markdown('intro'), markdownTemplate('prepare', {
|
|
17
|
+
version: semverVersion,
|
|
18
|
+
packageName
|
|
19
|
+
}), markdown('node-version'), markdownTemplate('update-version', {
|
|
20
|
+
packageName
|
|
21
|
+
}), markdown('cli'), '## Breaking Changes', markdown('orgs-claim'), markdown('image-url'), accordionForCategory('image-url'), deprecationRemovalsAndHousekeeping(['hof-removal', 'pagination-return', 'pagination-args', 'error-imports'])]);
|
|
22
|
+
}
|
|
23
|
+
generate().then(writeToFile(cwd));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Core 2 is included in the Fastify SDK starting with version 1. This release ships with a variety of smaller DX improvements and housekeeping items. Each of the potentially breaking changes are detailed in this guide, below.
|
|
2
|
+
|
|
3
|
+
By the end of this guide, you’ll have successfully upgraded your Fastify project to use `@clerk/fastify` 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.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, writeToFile } from '../../text-generation.js';
|
|
2
|
+
const version = 'core-2';
|
|
3
|
+
const semverVersion = 'v5';
|
|
4
|
+
const name = 'gatsby';
|
|
5
|
+
const properName = 'Gatsby';
|
|
6
|
+
const packageName = 'gatsby-plugin-clerk';
|
|
7
|
+
const cwd = `${version}/${name}`;
|
|
8
|
+
async function generate() {
|
|
9
|
+
const data = await loadVersionChangeData(version, name);
|
|
10
|
+
return assembleContent({
|
|
11
|
+
data,
|
|
12
|
+
cwd
|
|
13
|
+
}, [frontmatter({
|
|
14
|
+
title: `Upgrading ${properName} to Core 2`,
|
|
15
|
+
description: `Learn how to upgrade Clerk's ${properName} SDK to the latest version`
|
|
16
|
+
}), `# Upgrading \`${packageName}\` to Core 2`, markdown('intro'), markdownTemplate('prepare', {
|
|
17
|
+
version: semverVersion,
|
|
18
|
+
packageName
|
|
19
|
+
}), markdown('node-version'), markdown('react-version'), markdownTemplate('update-version', {
|
|
20
|
+
packageName: 'gatsby-plugin-clerk'
|
|
21
|
+
}), markdown('cli'), '## Breaking Changes', markdown('redesign-preview'), markdown('after-sign-x-handling'), markdown('orgs-claim'), markdownTemplate('path-routing', {
|
|
22
|
+
packageName
|
|
23
|
+
}), markdown('image-url'), accordionForCategory('image-url'), deprecationRemovalsAndHousekeeping()]);
|
|
24
|
+
}
|
|
25
|
+
generate().then(writeToFile(cwd));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Core 2 is included in the Gatsby SDK starting with version 5. 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.
|
|
2
|
+
|
|
3
|
+
By the end of this guide, you’ll have successfully upgraded your Gatsby project to use `gatsby-plugin-clerk` 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.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
4
|
+
|
|
5
|
+
node $SCRIPT_DIR/overview/index.js
|
|
6
|
+
node $SCRIPT_DIR/backend/index.js
|
|
7
|
+
node $SCRIPT_DIR/chrome-extension/index.js
|
|
8
|
+
node $SCRIPT_DIR/expo/index.js
|
|
9
|
+
node $SCRIPT_DIR/fastify/index.js
|
|
10
|
+
node $SCRIPT_DIR/gatsby/index.js
|
|
11
|
+
node $SCRIPT_DIR/js/index.js
|
|
12
|
+
node $SCRIPT_DIR/nextjs/index.js
|
|
13
|
+
node $SCRIPT_DIR/node/index.js
|
|
14
|
+
node $SCRIPT_DIR/react/index.js
|
|
15
|
+
node $SCRIPT_DIR/remix/index.js
|
|
16
|
+
node $SCRIPT_DIR/retheme/index.js
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, writeToFile } from '../../text-generation.js';
|
|
2
|
+
const version = 'core-2';
|
|
3
|
+
const semverVersion = 'v5';
|
|
4
|
+
const name = 'js';
|
|
5
|
+
const properName = 'Javascript';
|
|
6
|
+
const packageName = '@clerk/clerk-js';
|
|
7
|
+
const cwd = `${version}/${name}`;
|
|
8
|
+
async function generate() {
|
|
9
|
+
const data = await loadVersionChangeData(version, name);
|
|
10
|
+
return assembleContent({
|
|
11
|
+
data,
|
|
12
|
+
cwd
|
|
13
|
+
}, [frontmatter({
|
|
14
|
+
title: `Upgrading ${properName} to Core 2`,
|
|
15
|
+
description: `Learn how to upgrade Clerk's ${properName} SDK to the latest version.`
|
|
16
|
+
}), `# Upgrading \`${packageName}\` to Core 2`, markdown('intro'), markdownTemplate('prepare', {
|
|
17
|
+
version: semverVersion,
|
|
18
|
+
packageName
|
|
19
|
+
}), markdownTemplate('update-version', {
|
|
20
|
+
packageName
|
|
21
|
+
}), markdown('cli'), '## Breaking Changes', markdown('redesign-preview'), markdown('after-sign-x-handling'), markdown('orgs-claim'), markdownTemplate('path-routing', {
|
|
22
|
+
packageName
|
|
23
|
+
}), markdown('image-url'), accordionForCategory('image-url'), markdown('pagination-args'), accordionForCategory('pagination-args'), markdown('pagination-return'), accordionForCategory('pagination-return'),
|
|
24
|
+
// createOrganization args?
|
|
25
|
+
// attemptweb3wallet?
|
|
26
|
+
deprecationRemovalsAndHousekeeping(['error-imports'])]);
|
|
27
|
+
}
|
|
28
|
+
generate().then(writeToFile(cwd));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Core 2 is included in the Javascript SDK starting with version 5. 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.
|
|
2
|
+
|
|
3
|
+
By the end of this guide, you'll have successfully upgraded your JS project to use `@clerk/clerk-js` 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.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
### Changes to top-level exports
|
|
2
|
+
|
|
3
|
+
As part of this release, some of the top-level exports of `@clerk/nextjs` have been changed in order to improve bundle size and tree-shaking efficiency. These changes have resulted in a ~75% reduction in build size for middleware bundles. However, you will likely need to make some changes to import paths as a result.
|
|
4
|
+
|
|
5
|
+
<Callout type='info'>
|
|
6
|
+
Use [the CLI tool](#cli-upgrade-helper) to automatically find occurences of imports that need to be changed.
|
|
7
|
+
</Callout>
|
|
8
|
+
|
|
9
|
+
<Accordion titles={["@clerk/nextjs/server", "@clerk/nextjs/errors", "@clerk/nextjs/app-beta", "@clerk/nextjs/ssr", "@clerk/nextjs/edge-middleware", "@clerk/nextjs/edge-middlewarefiles", "@clerk/nextjs/api"]}>
|
|
10
|
+
<AccordionPanel>
|
|
11
|
+
Previously these exports have been exported both from `@clerk/nextjs` and `@clerk/nextjs/server`. As of v5 they are only exported from the latter. Going forward, the expectation can be that any imports that are intended to run within react on the client side, will come from `@clerk/nextjs` and imports that are intended to run on the server, will come from `@clerk/nextjs/server`.
|
|
12
|
+
|
|
13
|
+
```diff
|
|
14
|
+
import {
|
|
15
|
+
auth,
|
|
16
|
+
currentUser,
|
|
17
|
+
authMiddleware,
|
|
18
|
+
buildClerkProps,
|
|
19
|
+
verifyToken,
|
|
20
|
+
verifyJwt,
|
|
21
|
+
decodeJwt,
|
|
22
|
+
signJwt,
|
|
23
|
+
constants,
|
|
24
|
+
redirect,
|
|
25
|
+
createAuthenticateRequest,
|
|
26
|
+
createIsomorphicRequest,
|
|
27
|
+
- } from "@clerk/nextjs"
|
|
28
|
+
+ } from "@clerk/nextjs/server"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
</AccordionPanel>
|
|
32
|
+
<AccordionPanel>
|
|
33
|
+
Exports related to errors are now under `@clerk/nextjs/errors`.
|
|
34
|
+
|
|
35
|
+
```diff
|
|
36
|
+
import {
|
|
37
|
+
isClerkAPIResponseError,
|
|
38
|
+
isEmailLinkError,
|
|
39
|
+
isKnownError,
|
|
40
|
+
isMetamaskError,
|
|
41
|
+
EmailLinkErrorCode,
|
|
42
|
+
- } from "@clerk/nextjs"
|
|
43
|
+
+ } from "@clerk/nextjs/errors"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
</AccordionPanel>
|
|
47
|
+
<AccordionPanel>
|
|
48
|
+
The `@clerk/nextjs` import will work with both the app and pages router.
|
|
49
|
+
|
|
50
|
+
```diff
|
|
51
|
+
- import { } from "@clerk/nextjs/app-beta"
|
|
52
|
+
+ import { } from "@clerk/nextjs"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Some behavior may have changed between Clerk's beta and the stable release. Please check on your end if behavior stayed the same.
|
|
56
|
+
|
|
57
|
+
</AccordionPanel>
|
|
58
|
+
<AccordionPanel>
|
|
59
|
+
The top-level exports support SSR by default now.
|
|
60
|
+
|
|
61
|
+
```diff
|
|
62
|
+
- import { } from "@clerk/nextjs/ssr"
|
|
63
|
+
+ import { } from "@clerk/nextjs"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
</AccordionPanel>
|
|
67
|
+
<AccordionPanel>
|
|
68
|
+
```diff
|
|
69
|
+
- import { } from "@clerk/nextjs/edge-middleware"
|
|
70
|
+
+ import { } from "@clerk/nextjs"
|
|
71
|
+
```
|
|
72
|
+
</AccordionPanel>
|
|
73
|
+
<AccordionPanel>
|
|
74
|
+
```diff
|
|
75
|
+
- import { } from "@clerk/nextjs/edge-middlewarefiles"
|
|
76
|
+
+ import { } from "@clerk/nextjs"
|
|
77
|
+
```
|
|
78
|
+
</AccordionPanel>
|
|
79
|
+
<AccordionPanel>
|
|
80
|
+
The `@clerk/nextjs/api` subpath was removed completely. It re-exported helpers from `@clerk/clerk-sdk-node` and its types. If you relied on these, import from `@clerk/clerk-sdk-node` directly instead.
|
|
81
|
+
|
|
82
|
+
```diff
|
|
83
|
+
import type {
|
|
84
|
+
ClerkMiddleware,
|
|
85
|
+
ClerkMiddlewareOptions,
|
|
86
|
+
LooseAuthProp,
|
|
87
|
+
RequireAuthProp,
|
|
88
|
+
StrictAuthProp,
|
|
89
|
+
WithAuthProp
|
|
90
|
+
- } from "@clerk/nextjs/api"
|
|
91
|
+
+ } from "@clerk/clerk-sdk-node"
|
|
92
|
+
|
|
93
|
+
- import { requireAuth, withAuth } from "@clerk/nextjs/api"
|
|
94
|
+
+ import { requireAuth, withAuth } from "@clerk/clerk-sdk-node"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
</AccordionPanel>
|
|
98
|
+
</Accordion>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, writeToFile } from '../../text-generation.js';
|
|
2
|
+
const version = 'core-2';
|
|
3
|
+
const semverVersion = 'v5';
|
|
4
|
+
const name = 'nextjs';
|
|
5
|
+
const properName = 'Next.js';
|
|
6
|
+
const packageName = '@clerk/nextjs';
|
|
7
|
+
const cwd = `${version}/${name}`;
|
|
8
|
+
async function generate() {
|
|
9
|
+
const data = await loadVersionChangeData(version, name);
|
|
10
|
+
return assembleContent({
|
|
11
|
+
data,
|
|
12
|
+
cwd
|
|
13
|
+
}, [frontmatter({
|
|
14
|
+
title: `Upgrading ${properName} to Core 2`,
|
|
15
|
+
description: `Learn how to upgrade Clerk's ${properName} SDK to the latest version.`
|
|
16
|
+
}), `# Upgrading \`${packageName}\` to Core 2`, markdown('intro'), markdownTemplate('prepare', {
|
|
17
|
+
version: semverVersion,
|
|
18
|
+
packageName
|
|
19
|
+
}), markdown('node-version'), markdown('react-version'), markdown('nextjs-version'), markdownTemplate('update-version', {
|
|
20
|
+
packageName
|
|
21
|
+
}), markdown('cli'), '## Breaking Changes', markdown('redesign-preview'), markdown('middleware-changes'), markdown('import-changes'), markdown('after-sign-x-handling'), markdown('orgs-claim'), markdownTemplate('path-routing', {
|
|
22
|
+
packageName
|
|
23
|
+
}), markdown('image-url'), accordionForCategory('image-url'), deprecationRemovalsAndHousekeeping(['hof-removal', 'pagination-return', 'pagination-args', 'error-imports'])]);
|
|
24
|
+
}
|
|
25
|
+
generate().then(writeToFile(cwd));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Core 2 is included in the Next.js SDK starting with version 5.0.0. This new version ships with an improved design and UX for its built-in components, no "flash of white page" when authenticating, a substantially improved middleware import, and a variety of smaller DX improvements and housekeeping items. Each of the potentially breaking changes are detailed in this guide, below.
|
|
2
|
+
|
|
3
|
+
By the end of this guide, you’ll have successfully upgraded your Next.js project to use `@clerk/nextjs` 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.
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
### New Middleware architecture
|
|
2
|
+
|
|
3
|
+
User and customer feedback about `authMiddleware()` has been clear in that Middleware logic was a often friction point. As such, in v5 you will find a completely new Middleware helper called [`clerkMiddleware()`](/docs/references/nextjs/clerk-middleware) that should alleviate the issues folks had with `authMiddleware()`.
|
|
4
|
+
|
|
5
|
+
Additionally, there are now new helpers that enable controlling auth on a _per-page and/or per-layout basis_ when using App Router. While you can still configure which routes are protected via Middleware, the page-based protection strategy is what is now recommended, as the co-location of auth protection configuration with the code for the pages themselves results in a superior developer experience that adds clarity as you navigate your codebase.
|
|
6
|
+
|
|
7
|
+
#### Per-route auth config
|
|
8
|
+
|
|
9
|
+
Sometimes, code speaks louder than words. Let's get right into an example:
|
|
10
|
+
|
|
11
|
+
<Tabs type="auth-protect-layout-page" items={["Layout", "Page"]}>
|
|
12
|
+
<Tab>
|
|
13
|
+
```ts filename="app/src/dashboard/layout.tsx"
|
|
14
|
+
import { auth } from '@clerk/nextjs/server'
|
|
15
|
+
|
|
16
|
+
export default async function DashboardLayout({ children }) {
|
|
17
|
+
auth().protect();
|
|
18
|
+
// 👆 This one line is all it takes - the layout and all its children
|
|
19
|
+
// will now redirect to your sign in page for un-authenticated users.
|
|
20
|
+
|
|
21
|
+
return <>{children}</>
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
</Tab>
|
|
26
|
+
<Tab>
|
|
27
|
+
```ts filename="app/src/dashboard/page.tsx"
|
|
28
|
+
import { auth } from '@clerk/nextjs/server'
|
|
29
|
+
|
|
30
|
+
export default async function DashboardPage() {
|
|
31
|
+
auth().protect();
|
|
32
|
+
// 👆 This one line is all it takes - the layout and all its children
|
|
33
|
+
// will now redirect to your sign in page for un-authenticated users.
|
|
34
|
+
|
|
35
|
+
return <p>This page is now protected!</p>
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
</Tab>
|
|
40
|
+
</Tabs>
|
|
41
|
+
|
|
42
|
+
In this example, you add [`auth().protect()`](/docs/references/nextjs/auth#protect) to a layout and that layout and all of it's children will be gated by auth. The same logic can be applied for pages.
|
|
43
|
+
|
|
44
|
+
For more details on route protection, check out the [route protection guide](/references/nextjs/route-protection).
|
|
45
|
+
|
|
46
|
+
If you are using the pages router, per-route gating won't work. Instead, configure your auth gating via Middleware as described in the next section.
|
|
47
|
+
|
|
48
|
+
#### Middleware auth config
|
|
49
|
+
|
|
50
|
+
If you prefer to define your auth logic within the Middleware, you can still do this using the new `clerkMiddleware`. The primary change from the previous `authMiddleware()` is that `clerkMiddleware()` does not protect any routes by default, instead requiring the developer to add routes they would like to be protected by auth. This is a substantial contrast to the previous `authMiddleware()`, which protected all routes by default, requiring the developer to add exceptions. The API was also substantially simplified, and it has become easier to combine with other Middleware helpers smoothly as well.
|
|
51
|
+
|
|
52
|
+
Here's an example that replicates the auth protection scheme above, but entirely inside the Middleware:
|
|
53
|
+
|
|
54
|
+
```ts filename="middleware.ts"
|
|
55
|
+
import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server';
|
|
56
|
+
|
|
57
|
+
const isDashboardRoute = createRouteMatcher(['/dashboard(.*)']);
|
|
58
|
+
const isAdminRoute = createRouteMatcher(['/admin(.*)']);
|
|
59
|
+
|
|
60
|
+
export default clerkMiddleware((auth, req) => {
|
|
61
|
+
// Restrict admin route to users with specific role
|
|
62
|
+
if (isAdminRoute(req)) auth().protect({ role: 'org:admin' });
|
|
63
|
+
|
|
64
|
+
// Restrict dashboard routes to logged in users
|
|
65
|
+
if (isDashboardRoute(req)) auth().protect();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export const config = {
|
|
69
|
+
matcher: ['/((?!.*\\..*|_next).*)', '/', '/(api|trpc)(.*)'],
|
|
70
|
+
};
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
A couple things to note here:
|
|
74
|
+
|
|
75
|
+
- The `createRouteMatcher` helper makes it easy to define route groups that you can leverage inside the Middleware function and check in whichever order you'd like. Note that it can take an array of routes as well.
|
|
76
|
+
- With `clerkMiddleware`, you're defining the routes you want **to be protected**, rather than the routes you don't want to be protected.
|
|
77
|
+
- You are able to use the same `auth().protect()` helpers that you can use within layouts/pages here in the Middleware.
|
|
78
|
+
|
|
79
|
+
#### Migrating to `clerkMiddleware()`
|
|
80
|
+
|
|
81
|
+
Clerk strongly recommends migrating to the new `clerkMiddleware()` for an improved DX and access to all present and upcoming features, but also want to note that `authMiddleware()`, while deprecated, will continue to work in v5 and will not be removed until the next major version, so you do not _need_ to make any changes to your Middleware setup this version.
|
|
82
|
+
|
|
83
|
+
The most basic migration will be updating the import and changing out the default export, then mirroring the previous behavior of protecting all routes as such:
|
|
84
|
+
|
|
85
|
+
```diff
|
|
86
|
+
- import { authMiddleware } from "@clerk/nextjs"
|
|
87
|
+
+ import { clerkMiddleware } from '@clerk/nextjs/server'
|
|
88
|
+
|
|
89
|
+
- export default authMiddleware()
|
|
90
|
+
+ export default clerkMiddleware((auth) => auth().protect())
|
|
91
|
+
|
|
92
|
+
export const config = {
|
|
93
|
+
matcher: ["/((?!.*\\..*|_next).*)", "/", "/(api|trpc)(.*)"],
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Of course, in most cases you'll have a more complicated setup than this. You can find some examples below for how to migrate a few common use cases. Be sure to review the [`clerkMiddleware()` documentation](/docs/references/nextjs/clerk-middleware) and [route protection guide](/docs/references/nextjs/route-protection) if your specific use case is not mentioned.
|
|
98
|
+
|
|
99
|
+
<Accordion titles={["Protecting all routes except one or more public paths", "Protecting a single route path", "Combining with other Middlewares (like i18n)"]} heading="h4">
|
|
100
|
+
<AccordionPanel>
|
|
101
|
+
By default, `clerkMiddleware()` treats all pages as public unless explicitly protected. If you prefer for it to operate the other way around (all pages are protected unless explicitly made public), you can reverse the middleware logic in this way:
|
|
102
|
+
|
|
103
|
+
Before:
|
|
104
|
+
|
|
105
|
+
```ts filename="middleware.ts"
|
|
106
|
+
import { authMiddleware } from "@clerk/nextjs"
|
|
107
|
+
|
|
108
|
+
export default authMiddleware({
|
|
109
|
+
publicRoutes: ["/", "/contact"],
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
export const config = {
|
|
113
|
+
matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
After:
|
|
118
|
+
|
|
119
|
+
```ts filename="middleware.ts"
|
|
120
|
+
import {
|
|
121
|
+
clerkMiddleware,
|
|
122
|
+
createRouteMatcher
|
|
123
|
+
} from "@clerk/nextjs/server"
|
|
124
|
+
|
|
125
|
+
const isPublicRoute = createRouteMatcher(["/", "/contact"])
|
|
126
|
+
|
|
127
|
+
export default clerkMiddleware((auth, req) => {
|
|
128
|
+
if (isPublicRoute(req)) return // if it's a public route, do nothing
|
|
129
|
+
auth().protect() // for any other route, require auth
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
export const config = {
|
|
133
|
+
matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
</AccordionPanel>
|
|
138
|
+
<AccordionPanel>
|
|
139
|
+
An example can be seen below of code that ensures that all routes are public except everything under `/dashboard`.
|
|
140
|
+
|
|
141
|
+
Before:
|
|
142
|
+
|
|
143
|
+
```ts filename="middleware.ts"
|
|
144
|
+
import { authMiddleware } from "@clerk/nextjs"
|
|
145
|
+
|
|
146
|
+
export default authMiddleware({
|
|
147
|
+
publicRoutes: (req) => !req.url.includes("/dashboard"),
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
export const config = {
|
|
151
|
+
matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
After:
|
|
156
|
+
|
|
157
|
+
```ts filename="middleware.ts"
|
|
158
|
+
import {
|
|
159
|
+
clerkMiddleware,
|
|
160
|
+
createRouteMatcher
|
|
161
|
+
} from "@clerk/nextjs/server"
|
|
162
|
+
|
|
163
|
+
const isDashboardRoute = createRouteMatcher(["/dashboard(.*)"])
|
|
164
|
+
|
|
165
|
+
export default clerkMiddleware((auth, request) => {
|
|
166
|
+
if (isDashboardRoute(request)) auth().protect()
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
export const config = {
|
|
170
|
+
matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
</AccordionPanel>
|
|
175
|
+
<AccordionPanel>
|
|
176
|
+
You can call other Middlewares inside `clerkMiddleware()`, giving you more direct control over what is called where. An example would be [next-intl](https://next-intl-docs.vercel.app/) to add internationalization to your app.
|
|
177
|
+
|
|
178
|
+
Before:
|
|
179
|
+
|
|
180
|
+
```ts filename="middleware.ts"
|
|
181
|
+
import { authMiddleware } from "@clerk/nextjs"
|
|
182
|
+
import createMiddleware from "next-intl/middleware"
|
|
183
|
+
|
|
184
|
+
const intlMiddleware = createMiddleware({
|
|
185
|
+
locales: ["en", "de"],
|
|
186
|
+
defaultLocale: "en",
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
export default authMiddleware({
|
|
190
|
+
beforeAuth: (req) => {
|
|
191
|
+
return intlMiddleware(req);
|
|
192
|
+
},
|
|
193
|
+
publicRoutes: ["((?!^/dashboard/).*)"],
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
export const config = {
|
|
197
|
+
matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
After:
|
|
202
|
+
|
|
203
|
+
```ts filename="middleware.ts"
|
|
204
|
+
import {
|
|
205
|
+
clerkMiddleware,
|
|
206
|
+
createRouteMatcher
|
|
207
|
+
} from "@clerk/nextjs/server"
|
|
208
|
+
import createMiddleware from "next-intl/middleware"
|
|
209
|
+
|
|
210
|
+
const intlMiddleware = createMiddleware({
|
|
211
|
+
locales: ["en", "de"],
|
|
212
|
+
defaultLocale: "en",
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
const isDashboardRoute = createRouteMatcher(["/dashboard(.*)"])
|
|
216
|
+
|
|
217
|
+
export default clerkMiddleware((auth, request) => {
|
|
218
|
+
if (isDashboardRoute(request)) auth().protect()
|
|
219
|
+
|
|
220
|
+
return intlMiddleware(request)
|
|
221
|
+
})
|
|
222
|
+
|
|
223
|
+
export const config = {
|
|
224
|
+
matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
</AccordionPanel>
|
|
229
|
+
</Accordion>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
**Updating Next.js**
|
|
2
|
+
|
|
3
|
+
`@clerk/nextjs` now requires you to use Next.js version `13.0.4` or later. Check out Next's upgrade guides for more guidance if you have not yet upgraded to Next.js 13:
|
|
4
|
+
|
|
5
|
+
- [Upgrading from 12 to 13](https://nextjs.org/docs/pages/building-your-application/upgrading/version-13)
|
|
6
|
+
- [Upgrading from 13 to 14](https://nextjs.org/docs/app/building-your-application/upgrading/version-14)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, singleItem, writeToFile } from '../../text-generation.js';
|
|
2
|
+
const version = 'core-2';
|
|
3
|
+
const semverVersion = 'v5';
|
|
4
|
+
const name = 'node';
|
|
5
|
+
const properName = 'Node';
|
|
6
|
+
const packageName = '@clerk/clerk-sdk-node';
|
|
7
|
+
const cwd = `${version}/${name}`;
|
|
8
|
+
async function generate() {
|
|
9
|
+
const data = await loadVersionChangeData(version, name);
|
|
10
|
+
return assembleContent({
|
|
11
|
+
data,
|
|
12
|
+
cwd
|
|
13
|
+
}, [frontmatter({
|
|
14
|
+
title: `Upgrading ${properName} to Core 2`,
|
|
15
|
+
description: `Learn how to upgrade Clerk's ${properName} SDK to the lastest version.`
|
|
16
|
+
}), `# Upgrading \`${packageName}\` to Core 2`, markdown('intro'), markdownTemplate('prepare', {
|
|
17
|
+
version: semverVersion,
|
|
18
|
+
packageName
|
|
19
|
+
}), markdown('node-version'), markdownTemplate('update-version', {
|
|
20
|
+
packageName
|
|
21
|
+
}), markdown('cli'), '## Breaking Changes', singleItem('cjs-esm-instance'), markdown('node-setters-removals'), markdown('orgs-claim'), markdown('image-url'), accordionForCategory('image-url'), deprecationRemovalsAndHousekeeping(['pagination-return', 'pagination-args', 'error-imports'])]);
|
|
22
|
+
}
|
|
23
|
+
generate().then(writeToFile(cwd));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Core 2 is included in the Node.js SDK starting with version 5. This new version ships with a variety of smaller DX improvements and housekeeping items. Each of the potentially breaking changes are detailed in this guide, below.
|
|
2
|
+
|
|
3
|
+
By the end of this guide, you’ll have successfully upgraded your Node project to use `@clerk/clerk-sdk-node` 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.
|