@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.
Files changed (397) hide show
  1. package/dist/guide-generators/text-generation.js +109 -0
  2. package/dist/guide-generators/v5/backend/__output.mdx +580 -0
  3. package/dist/guide-generators/v5/backend/import-moves.mdx +3 -0
  4. package/dist/guide-generators/v5/backend/import-paths.mdx +3 -0
  5. package/dist/guide-generators/v5/backend/index.js +22 -0
  6. package/dist/guide-generators/v5/backend/intro.mdx +3 -0
  7. package/dist/guide-generators/v5/chrome-extension/index.js +19 -0
  8. package/dist/guide-generators/v5/chrome-extension/intro.mdx +3 -0
  9. package/dist/guide-generators/v5/chromeExtension/__output.mdx +409 -0
  10. package/dist/guide-generators/v5/chromeExtension/index.js +24 -0
  11. package/dist/guide-generators/v5/chromeExtension/intro.mdx +3 -0
  12. package/dist/guide-generators/v5/expo/__output.mdx +455 -0
  13. package/dist/guide-generators/v5/expo/index.js +24 -0
  14. package/dist/guide-generators/v5/expo/intro.mdx +3 -0
  15. package/dist/guide-generators/v5/fastify/__output.mdx +373 -0
  16. package/dist/guide-generators/v5/fastify/index.js +22 -0
  17. package/dist/guide-generators/v5/fastify/intro.mdx +3 -0
  18. package/dist/guide-generators/v5/gatsby/__output.mdx +472 -0
  19. package/dist/guide-generators/v5/gatsby/index.js +24 -0
  20. package/dist/guide-generators/v5/gatsby/intro.mdx +3 -0
  21. package/dist/guide-generators/v5/generate-all.js +0 -0
  22. package/dist/guide-generators/v5/generate-all.sh +16 -0
  23. package/dist/guide-generators/v5/generate.js +263 -0
  24. package/dist/guide-generators/v5/intro.mdx +15 -0
  25. package/dist/guide-generators/v5/js/__output.mdx +528 -0
  26. package/dist/guide-generators/v5/js/index.js +27 -0
  27. package/dist/guide-generators/v5/js/intro.mdx +3 -0
  28. package/dist/guide-generators/v5/js/pagination-args.mdx +3 -0
  29. package/dist/guide-generators/v5/js/pagination-return.mdx +3 -0
  30. package/dist/guide-generators/v5/nextjs/__output.mdx +1091 -0
  31. package/dist/guide-generators/v5/nextjs/after-sign-x-handling.mdx +10 -0
  32. package/dist/guide-generators/v5/nextjs/deprecation-removals.mdx +9 -0
  33. package/dist/guide-generators/v5/nextjs/import-changes.mdx +98 -0
  34. package/dist/guide-generators/v5/nextjs/index.js +24 -0
  35. package/dist/guide-generators/v5/nextjs/intro.mdx +3 -0
  36. package/dist/guide-generators/v5/nextjs/middleware-changes.mdx +251 -0
  37. package/dist/guide-generators/v5/nextjs/nextjs-versio.mdx +34 -0
  38. package/dist/guide-generators/v5/nextjs/nextjs-version.mdx +6 -0
  39. package/dist/guide-generators/v5/nextjs/retheme-changes.mdx +10 -0
  40. package/dist/guide-generators/v5/nextjs/version-requirements.mdx +34 -0
  41. package/dist/guide-generators/v5/node/__output.mdx +511 -0
  42. package/dist/guide-generators/v5/node/index.js +22 -0
  43. package/dist/guide-generators/v5/node/intro.mdx +3 -0
  44. package/dist/guide-generators/v5/node/node-setters-removals.mdx +34 -0
  45. package/dist/guide-generators/v5/overview/__output.mdx +37 -0
  46. package/dist/guide-generators/v5/overview/index.js +12 -0
  47. package/dist/guide-generators/v5/overview/intro.mdx +31 -0
  48. package/dist/guide-generators/v5/overview/per-sdk.mdx +16 -0
  49. package/dist/guide-generators/v5/per-sdk.mdx +16 -0
  50. package/dist/guide-generators/v5/prepare.mdx +135 -0
  51. package/dist/guide-generators/v5/react/__output.mdx +679 -0
  52. package/dist/guide-generators/v5/react/hof-removals.mdx +3 -0
  53. package/dist/guide-generators/v5/react/index.js +24 -0
  54. package/dist/guide-generators/v5/react/intro.mdx +3 -0
  55. package/dist/guide-generators/v5/redesigned-components.mdx +11 -0
  56. package/dist/guide-generators/v5/remix/__output.mdx +401 -0
  57. package/dist/guide-generators/v5/remix/index.js +24 -0
  58. package/dist/guide-generators/v5/remix/intro.mdx +3 -0
  59. package/dist/guide-generators/v5/retheme/__output.mdx +437 -0
  60. package/dist/guide-generators/v5/retheme/index.js +24 -0
  61. package/dist/guide-generators/v5/retheme/intro.mdx +9 -0
  62. package/dist/guide-generators/v5/shared/after-sign-x-handling.mdx +10 -0
  63. package/dist/guide-generators/v5/shared/cli.mdx +22 -0
  64. package/dist/guide-generators/v5/shared/deprecation-removals.mdx +6 -0
  65. package/dist/guide-generators/v5/shared/hof-removals.mdx +3 -0
  66. package/dist/guide-generators/v5/shared/image-url.mdx +3 -0
  67. package/dist/guide-generators/v5/shared/node-setters-removals.mdx +34 -0
  68. package/dist/guide-generators/v5/shared/node-version.mdx +3 -0
  69. package/dist/guide-generators/v5/shared/orgs-claim.mdx +50 -0
  70. package/dist/guide-generators/v5/shared/pagination-args.mdx +3 -0
  71. package/dist/guide-generators/v5/shared/pagination-return.mdx +3 -0
  72. package/dist/guide-generators/v5/shared/path-routing.mdx +57 -0
  73. package/dist/guide-generators/v5/shared/prepare.mdx +10 -0
  74. package/dist/guide-generators/v5/shared/react-version.mdx +20 -0
  75. package/dist/guide-generators/v5/shared/redesign-preview.mdx +5 -0
  76. package/dist/guide-generators/v5/shared/update-v5.mdx +17 -0
  77. package/dist/guide-generators/v5/shared/update-version.mdx +18 -0
  78. package/dist/guide-generators/v5/single-page-old.js +192 -0
  79. package/dist/guide-generators/v5-guides/deprecation-removals.mdx +7 -0
  80. package/dist/guide-generators/v5-guides/generate.js +263 -0
  81. package/dist/guide-generators/v5-guides/hof-removals.mdx +3 -0
  82. package/dist/guide-generators/v5-guides/intro.mdx +15 -0
  83. package/dist/guide-generators/v5-guides/nextjs/after-sign-x-handling.mdx +10 -0
  84. package/dist/guide-generators/v5-guides/nextjs/deprecation-removals.mdx +9 -0
  85. package/dist/guide-generators/v5-guides/nextjs/import-changes.mdx +98 -0
  86. package/dist/guide-generators/v5-guides/nextjs/index.js +80 -0
  87. package/dist/guide-generators/v5-guides/nextjs/intro.mdx +21 -0
  88. package/dist/guide-generators/v5-guides/nextjs/middleware-changes.mdx +251 -0
  89. package/dist/guide-generators/v5-guides/nextjs/retheme-changes.mdx +10 -0
  90. package/dist/guide-generators/v5-guides/nextjs/version-requirements.mdx +34 -0
  91. package/dist/guide-generators/v5-guides/node-setters-removals.mdx +34 -0
  92. package/dist/guide-generators/v5-guides/pagination-args.mdx +3 -0
  93. package/dist/guide-generators/v5-guides/pagination-return.mdx +3 -0
  94. package/dist/guide-generators/v5-guides/path-routing.mdx +50 -0
  95. package/dist/guide-generators/v5-guides/per-sdk.mdx +16 -0
  96. package/dist/guide-generators/v5-guides/prepare.mdx +135 -0
  97. package/dist/guide-generators/v5-guides/redesign-preview.mdx +5 -0
  98. package/dist/guide-generators/v5-guides/redesigned-components.mdx +11 -0
  99. package/dist/guide-generators/v5-guides/remix/index.js +15 -0
  100. package/dist/guide-generators/v5-guides/remix/intro.mdx +1 -0
  101. package/dist/guide-generators/v5-guides/remix/output.mdx +362 -0
  102. package/dist/guide-generators/v5-guides/shared/breaking-changes-intro.mdx +0 -0
  103. package/dist/guide-generators/v5-guides/shared/cli.mdx +21 -0
  104. package/dist/guide-generators/v5-guides/shared/deprecation-removals.mdx +7 -0
  105. package/dist/guide-generators/v5-guides/shared/hof-removals.mdx +3 -0
  106. package/dist/guide-generators/v5-guides/shared/node-setters-removals.mdx +34 -0
  107. package/dist/guide-generators/v5-guides/shared/node-version.mdx +3 -0
  108. package/dist/guide-generators/v5-guides/shared/pagination-args.mdx +3 -0
  109. package/dist/guide-generators/v5-guides/shared/pagination-return.mdx +3 -0
  110. package/dist/guide-generators/v5-guides/shared/path-routing.mdx +50 -0
  111. package/dist/guide-generators/v5-guides/shared/prepare.mdx +7 -0
  112. package/dist/guide-generators/v5-guides/shared/react-version.mdx +19 -0
  113. package/dist/guide-generators/v5-guides/shared/redesign-preview.mdx +5 -0
  114. package/dist/guide-generators/v5-guides/shared/update-v5.mdx +17 -0
  115. package/dist/guide-generators/v5-guides/shared/upgrade-v5.mdx +17 -0
  116. package/dist/scan.js +4 -2
  117. package/dist/util/generate-nextjs-migration-guide.js +0 -0
  118. package/dist/util/generate-nextjs-v5-migration-guide.js +0 -0
  119. package/dist/util/load-change.js +1 -0
  120. package/dist/util/text-generation.js +29 -0
  121. package/dist/util/v5-guide/deprecation-removals.mdx +7 -0
  122. package/dist/util/v5-guide/generate.js +200 -0
  123. package/dist/util/v5-guide/getting-up-to-date.mdx +114 -0
  124. package/dist/util/v5-guide/hof-removals.mdx +3 -0
  125. package/dist/util/v5-guide/intro.mdx +15 -0
  126. package/dist/util/v5-guide/node-setters-removals.mdx +34 -0
  127. package/dist/util/v5-guide/pagination-args.mdx +3 -0
  128. package/dist/util/v5-guide/pagination-return.mdx +3 -0
  129. package/dist/util/v5-guide/path-routing.mdx +50 -0
  130. package/dist/util/v5-guide/per-sdk.mdx +16 -0
  131. package/dist/util/v5-guide/prepare.mdx +135 -0
  132. package/dist/util/v5-guide/redesign-preview.mdx +5 -0
  133. package/dist/util/v5-guide/redesigned-components.mdx +11 -0
  134. package/dist/util/v5-guide/remix.mdx +0 -0
  135. package/dist/util/v5-guides/deprecation-removals.mdx +7 -0
  136. package/dist/util/v5-guides/generate.js +200 -0
  137. package/dist/util/v5-guides/hof-removals.mdx +3 -0
  138. package/dist/util/v5-guides/intro.mdx +15 -0
  139. package/dist/util/v5-guides/nextjs/after-sign-x-handling.mdx +10 -0
  140. package/dist/util/v5-guides/nextjs/deprecation-removals.mdx +9 -0
  141. package/dist/util/v5-guides/nextjs/generate.js +80 -0
  142. package/dist/util/v5-guides/nextjs/import-changes.mdx +98 -0
  143. package/dist/util/v5-guides/nextjs/index.js +0 -0
  144. package/dist/util/v5-guides/nextjs/intro.mdx +21 -0
  145. package/dist/util/v5-guides/nextjs/middleware-changes.mdx +251 -0
  146. package/dist/util/v5-guides/nextjs/retheme-changes.mdx +10 -0
  147. package/dist/util/v5-guides/nextjs/version-requirements.mdx +34 -0
  148. package/dist/util/v5-guides/node-setters-removals.mdx +34 -0
  149. package/dist/util/v5-guides/pagination-args.mdx +3 -0
  150. package/dist/util/v5-guides/pagination-return.mdx +3 -0
  151. package/dist/util/v5-guides/path-routing.mdx +50 -0
  152. package/dist/util/v5-guides/per-sdk.mdx +16 -0
  153. package/dist/util/v5-guides/prepare.mdx +135 -0
  154. package/dist/util/v5-guides/redesign-preview.mdx +5 -0
  155. package/dist/util/v5-guides/redesigned-components.mdx +11 -0
  156. package/dist/util/v5-guides/remix/index.js +5 -0
  157. package/dist/util/v5-nextjs-guide/after-sign-x-handling.mdx +10 -0
  158. package/dist/util/v5-nextjs-guide/deprecation-removals.mdx +9 -0
  159. package/dist/util/v5-nextjs-guide/generate-nextjs-v5-migration-guide.js +0 -0
  160. package/dist/util/v5-nextjs-guide/generate.js +80 -0
  161. package/dist/util/v5-nextjs-guide/import-changes.mdx +98 -0
  162. package/dist/util/v5-nextjs-guide/intro.md +0 -0
  163. package/dist/util/v5-nextjs-guide/intro.mdx +21 -0
  164. package/dist/util/v5-nextjs-guide/middleware-changes.mdx +251 -0
  165. package/dist/util/v5-nextjs-guide/retheme-changes.mdx +11 -0
  166. package/dist/util/v5-nextjs-guide/version-requirements.mdx +34 -0
  167. package/dist/versions/v5/backend/appearance-organizationpreview-organizationswitcher.md +9 -0
  168. package/dist/versions/v5/backend/authenticaterequest-params-change.md +1 -0
  169. package/dist/versions/v5/backend/clockskewinseconds.md +1 -0
  170. package/dist/versions/v5/backend/constants-import-path-move.md +1 -0
  171. package/dist/versions/v5/backend/createauthenticaterequest-import-path-move.md +1 -0
  172. package/dist/versions/v5/backend/createclerkclient-apikey.md +1 -0
  173. package/dist/versions/v5/backend/createclerkclient-frontendapi.md +1 -0
  174. package/dist/versions/v5/backend/createisomorphicrequest-import-path-move.md +1 -0
  175. package/dist/versions/v5/backend/createisomorphicrequest-removed.md +1 -0
  176. package/dist/versions/v5/backend/decodejwt-import-path-move.md +1 -0
  177. package/dist/versions/v5/backend/externalaccount-picture.md +1 -0
  178. package/dist/versions/v5/backend/externalaccountjson-avatarurl.md +1 -0
  179. package/dist/versions/v5/backend/getorganizationinvitationlist-return-signature.md +1 -0
  180. package/dist/versions/v5/backend/getorganizationinvitationlist-return-type-change.md +17 -0
  181. package/dist/versions/v5/backend/getorganizationlist-return-signature.md +1 -0
  182. package/dist/versions/v5/backend/getorganizationmembershiplist-return-signature.md +1 -0
  183. package/dist/versions/v5/backend/httpoptions-removed.md +2 -1
  184. package/dist/versions/v5/backend/organizationjson-logourl.md +1 -0
  185. package/dist/versions/v5/backend/organizationmembershippublicuserdatajson-profileimageurl.md +1 -0
  186. package/dist/versions/v5/backend/redirect-import-path-move.md +1 -0
  187. package/dist/versions/v5/backend/signjwt-import-path-move.md +1 -0
  188. package/dist/versions/v5/backend/signjwterror-import-move.md +1 -0
  189. package/dist/versions/v5/backend/tokenverificationerror-import-move.md +1 -0
  190. package/dist/versions/v5/backend/tokenverificationerroraction-import-move.md +1 -0
  191. package/dist/versions/v5/backend/tokenverificationerrorcode-import-move.md +1 -0
  192. package/dist/versions/v5/backend/tokenverificationerrorreason-import-move.md +1 -0
  193. package/dist/versions/v5/backend/userjson-profileimageurl.md +1 -0
  194. package/dist/versions/v5/backend/verifyjwt-import-path-move.md +1 -0
  195. package/dist/versions/v5/chromeExtension/clerkprovider-tokencache.md +8 -10
  196. package/dist/versions/v5/common/aftersigninurl-behavior-change-2.md +1 -0
  197. package/dist/versions/v5/common/aftersignouturl-behavior-change.md +1 -0
  198. package/dist/versions/v5/common/aftersignupurl-behavior-change.md +1 -0
  199. package/dist/versions/v5/common/afterswitchorganizationurl.md +1 -0
  200. package/dist/versions/v5/common/alternativemethods-backlink.md +1 -0
  201. package/dist/versions/v5/common/api-key-to-secret-key.md +1 -0
  202. package/dist/versions/v5/common/appearance-organizationpreview-organizationswitcher.md +1 -0
  203. package/dist/versions/v5/common/button-to-organizationlistcreateorganizationactionbutton.md +1 -0
  204. package/dist/versions/v5/common/card-changes.md +3 -2
  205. package/dist/versions/v5/common/changed-localization-keys.md +121 -120
  206. package/dist/versions/v5/common/clerkprovider-frontendapi-2.md +1 -0
  207. package/dist/versions/v5/common/clerkprovideroptionswrapper-dropped.md +1 -0
  208. package/dist/versions/v5/common/connected-accounts-dropdown.md +1 -0
  209. package/dist/versions/v5/common/emaillinkerrorcode-import-change.md +1 -0
  210. package/dist/versions/v5/common/externalaccount-avatarurl.md +7 -0
  211. package/dist/versions/v5/common/externalaccount-picture.md +7 -0
  212. package/dist/versions/v5/common/externalaccountjson-avatarurl.md +7 -0
  213. package/dist/versions/v5/common/frontend-api-to-publishable-key.md +1 -0
  214. package/dist/versions/v5/common/getorganizationinvitationlist-return-signature.md +15 -0
  215. package/dist/versions/v5/common/getorganizationinvitationlist-return-type-change.md +8 -5
  216. package/dist/versions/v5/common/getorganizationlist-return-signature.md +15 -0
  217. package/dist/versions/v5/common/getorganizationlist-return-type-change.md +2 -1
  218. package/dist/versions/v5/common/getorganizationmembershiplist-return-type-change.md +2 -1
  219. package/dist/versions/v5/common/isclerkapiresponserror-import-change.md +1 -0
  220. package/dist/versions/v5/common/isemaillinkerror-import-change.md +1 -0
  221. package/dist/versions/v5/common/isknownerror-import-change.md +1 -0
  222. package/dist/versions/v5/common/ismetamaskerror-import-change.md +6 -5
  223. package/dist/versions/v5/common/mfa-dropdown.md +1 -0
  224. package/dist/versions/v5/common/min-react-version.md +2 -0
  225. package/dist/versions/v5/common/multisessionappsupport-import-change.md +1 -1
  226. package/dist/versions/v5/common/navigate-to-routerpush-routerreplace.md +1 -0
  227. package/dist/versions/v5/common/new-localization-keys.md +121 -120
  228. package/dist/versions/v5/common/organization-create-string.md +12 -0
  229. package/dist/versions/v5/common/organization-getdomains-arguments-change.md +1 -0
  230. package/dist/versions/v5/common/organization-getinvitations-arguments-changed.md +1 -0
  231. package/dist/versions/v5/common/organization-getmembershiprequests-arguments-changed.md +1 -0
  232. package/dist/versions/v5/common/organization-getmemberships-arguments-changed.md +1 -0
  233. package/dist/versions/v5/common/organization-getpendinginvitations.md +11 -0
  234. package/dist/versions/v5/common/organization-getroles-arguments-changed.md +1 -0
  235. package/dist/versions/v5/common/organization-logourl.md +8 -0
  236. package/dist/versions/v5/common/organizationmembershippublicuserdata-profileimageurl.md +7 -0
  237. package/dist/versions/v5/common/organizationprofile-settings.md +1 -0
  238. package/dist/versions/v5/common/organizationswitcherpopoveractionbuttontext-removed.md +1 -0
  239. package/dist/versions/v5/common/remove-identitypreview-avatar.md +1 -0
  240. package/dist/versions/v5/common/remove-socialbuttonsblockbuttonarrow.md +1 -0
  241. package/dist/versions/v5/common/removed-localization-keys.md +74 -73
  242. package/dist/versions/v5/common/user-getorganizationinvitations-arguments-chanaged.md +1 -0
  243. package/dist/versions/v5/common/user-getorganizationinvitations-arguments-changed.md +16 -0
  244. package/dist/versions/v5/common/user-getorganizationmemberships-arguments-chanaged.md +1 -0
  245. package/dist/versions/v5/common/user-getorganizationmemberships-arguments-changed.md +16 -0
  246. package/dist/versions/v5/common/user-getorganizationsuggestions-arguments-chanaged.md +1 -0
  247. package/dist/versions/v5/common/user-getorganizationsuggestions-arguments-changed.md +16 -0
  248. package/dist/versions/v5/common/user-profileimageurl.md +7 -0
  249. package/dist/versions/v5/common/user-update-password.md +18 -0
  250. package/dist/versions/v5/common/userbuttonpopoveractionbuttontext-removed.md +1 -0
  251. package/dist/versions/v5/common/userbuttontrigger-userbuttonbox-invert.md +2 -1
  252. package/dist/versions/v5/common/userprofile-security.md +1 -0
  253. package/dist/versions/v5/common/withclerk-hof-removed.md +15 -14
  254. package/dist/versions/v5/common/withclerk-removed.md +1 -0
  255. package/dist/versions/v5/common/withsession-hof-removed.md +15 -14
  256. package/dist/versions/v5/common/withsession-removed.md +1 -0
  257. package/dist/versions/v5/common/withuser-hof-removed.md +15 -14
  258. package/dist/versions/v5/common/withuser-removed-2.md +1 -2
  259. package/dist/versions/v5/expo/apikey-to-publishable-key.md +1 -0
  260. package/dist/versions/v5/expo/clerkprovider-frontendapi.md +1 -0
  261. package/dist/versions/v5/fastify/clerkplugin-frontendapi.md +2 -1
  262. package/dist/versions/v5/fastify/createclerkclient-apikey.md +1 -0
  263. package/dist/versions/v5/fastify/createclerkclient-frontendapi.md +1 -0
  264. package/dist/versions/v5/gatsby/api-url-value-change.md +1 -1
  265. package/dist/versions/v5/gatsby/apikey-to-publishable-key.md +1 -0
  266. package/dist/versions/v5/gatsby/createclerkclient-apikey.md +1 -0
  267. package/dist/versions/v5/gatsby/createclerkclient-frontendapi.md +1 -0
  268. package/dist/versions/v5/gatsby/withserverauth-return-type.md +22 -30
  269. package/dist/versions/v5/index.js +16 -26
  270. package/dist/versions/v5/js/experimental-canusecaptcha.md +1 -0
  271. package/dist/versions/v5/js/experimental-captchasitekey.md +1 -0
  272. package/dist/versions/v5/js/experimental-captchaurl.md +1 -0
  273. package/dist/versions/v5/js/getorganizationmemberships.md +3 -6
  274. package/dist/versions/v5/js/redirecttohome.md +4 -4
  275. package/dist/versions/v5/js/signup-attemptweb3walletverification-generatedsignature.md +3 -2
  276. package/dist/versions/v5/js/unstable-invitationupdate.md +1 -0
  277. package/dist/versions/v5/js/unstable-membershipupdate.md +1 -0
  278. package/dist/versions/v5/js/user-createexternalaccount-redirecturl.md +1 -0
  279. package/dist/versions/v5/js/user-update-password.md +8 -9
  280. package/dist/versions/v5/next/auth-import-change.md +1 -0
  281. package/dist/versions/v5/next/auth-middleware-deprecated.md +8 -7
  282. package/dist/versions/v5/next/authmiddleware-apikey.md +5 -7
  283. package/dist/versions/v5/next/authmiddleware-frontendapi.md +2 -1
  284. package/dist/versions/v5/next/authmiddleware-import-change.md +1 -0
  285. package/dist/versions/v5/next/buildclerkprops-import-change.md +1 -0
  286. package/dist/versions/v5/next/clerk-import-change.md +1 -0
  287. package/dist/versions/v5/next/clerk-js-version-next-public.md +1 -0
  288. package/dist/versions/v5/next/constants-import-change.md +2 -1
  289. package/dist/versions/v5/next/createauthenticaterequest-import-change.md +1 -0
  290. package/dist/versions/v5/next/createclerkclient-apikey.md +2 -1
  291. package/dist/versions/v5/next/createclerkclient-frontendapi.md +2 -1
  292. package/dist/versions/v5/next/createisomorphicrequest-import-change.md +1 -0
  293. package/dist/versions/v5/next/currentuser-import-change.md +1 -0
  294. package/dist/versions/v5/next/decodejwt-import-change.md +1 -0
  295. package/dist/versions/v5/next/emaillinkerrorcode-import-change.md +1 -0
  296. package/dist/versions/v5/next/getauth-apikey.md +2 -1
  297. package/dist/versions/v5/next/import-api-url.md +2 -1
  298. package/dist/versions/v5/next/import-api-version.md +2 -1
  299. package/dist/versions/v5/next/import-clerk-js-url.md +2 -1
  300. package/dist/versions/v5/next/import-clerk-js-version.md +2 -1
  301. package/dist/versions/v5/next/import-domain.md +2 -1
  302. package/dist/versions/v5/next/import-is-satellite.md +2 -1
  303. package/dist/versions/v5/next/import-nextjs-api.md +7 -6
  304. package/dist/versions/v5/next/import-nextjs-app-beta.md +2 -1
  305. package/dist/versions/v5/next/import-nextjs-edge-middleware.md +1 -0
  306. package/dist/versions/v5/next/import-nextjs-edge-middlewarefiles.md +1 -0
  307. package/dist/versions/v5/next/import-nextjs-ssr.md +1 -0
  308. package/dist/versions/v5/next/import-proxy-url.md +2 -1
  309. package/dist/versions/v5/next/import-publishable-key.md +2 -1
  310. package/dist/versions/v5/next/import-secret-key.md +2 -1
  311. package/dist/versions/v5/next/import-sign-in-url.md +2 -1
  312. package/dist/versions/v5/next/import-sign-up-url.md +2 -1
  313. package/dist/versions/v5/next/isclerkapiresponserror-import-change.md +1 -0
  314. package/dist/versions/v5/next/isemaillinkerror-import-change.md +1 -0
  315. package/dist/versions/v5/next/isknownerror-import-change.md +1 -0
  316. package/dist/versions/v5/next/ismetamaskerror-import-change.md +1 -0
  317. package/dist/versions/v5/next/min-nextjs-version.md +2 -0
  318. package/dist/versions/v5/next/multisessionappsupport-import-change.md +1 -0
  319. package/dist/versions/v5/next/next-public-clerk-js-url.md +2 -1
  320. package/dist/versions/v5/next/redirect-import-change.md +1 -0
  321. package/dist/versions/v5/next/redirecttosignin-import-path.md +2 -1
  322. package/dist/versions/v5/next/redirecttosignup-import-path.md +2 -1
  323. package/dist/versions/v5/next/signjwt-import-change.md +1 -0
  324. package/dist/versions/v5/next/verifyjwt-import-change.md +1 -0
  325. package/dist/versions/v5/next/verifytoken-import-change.md +1 -0
  326. package/dist/versions/v5/next/with-clerk-middleware-removed.md +1 -0
  327. package/dist/versions/v5/nextjs/api-url-value-change.md +8 -0
  328. package/dist/versions/v5/nextjs/auth-import-change.md +14 -0
  329. package/dist/versions/v5/nextjs/auth-middleware-deprecated.md +50 -0
  330. package/dist/versions/v5/nextjs/authmiddleware-apikey.md +15 -0
  331. package/dist/versions/v5/nextjs/authmiddleware-frontendapi.md +15 -0
  332. package/dist/versions/v5/nextjs/authmiddleware-import-change.md +14 -0
  333. package/dist/versions/v5/nextjs/buildclerkprops-import-change.md +14 -0
  334. package/dist/versions/v5/nextjs/clerk-import-change.md +13 -0
  335. package/dist/versions/v5/nextjs/clerk-js-version-next-public.md +9 -0
  336. package/dist/versions/v5/nextjs/constants-import-change.md +14 -0
  337. package/dist/versions/v5/nextjs/createauthenticaterequest-import-change.md +14 -0
  338. package/dist/versions/v5/nextjs/createclerkclient-apikey.md +15 -0
  339. package/dist/versions/v5/nextjs/createclerkclient-frontendapi.md +15 -0
  340. package/dist/versions/v5/nextjs/createisomorphicrequest-import-change.md +14 -0
  341. package/dist/versions/v5/nextjs/currentuser-import-change.md +14 -0
  342. package/dist/versions/v5/nextjs/decodejwt-import-change.md +14 -0
  343. package/dist/versions/v5/nextjs/emaillinkerrorcode-import-change.md +14 -0
  344. package/dist/versions/v5/nextjs/getauth-apikey.md +13 -0
  345. package/dist/versions/v5/nextjs/import-api-url.md +8 -0
  346. package/dist/versions/v5/nextjs/import-api-version.md +8 -0
  347. package/dist/versions/v5/nextjs/import-clerk-js-url.md +8 -0
  348. package/dist/versions/v5/nextjs/import-clerk-js-version.md +8 -0
  349. package/dist/versions/v5/nextjs/import-domain.md +8 -0
  350. package/dist/versions/v5/nextjs/import-is-satellite.md +8 -0
  351. package/dist/versions/v5/nextjs/import-nextjs-api.md +21 -0
  352. package/dist/versions/v5/nextjs/import-nextjs-app-beta.md +11 -0
  353. package/dist/versions/v5/nextjs/import-nextjs-edge-middleware.md +7 -0
  354. package/dist/versions/v5/nextjs/import-nextjs-edge-middlewarefiles.md +7 -0
  355. package/dist/versions/v5/nextjs/import-nextjs-ssr.md +8 -0
  356. package/dist/versions/v5/nextjs/import-proxy-url.md +8 -0
  357. package/dist/versions/v5/nextjs/import-publishable-key.md +8 -0
  358. package/dist/versions/v5/nextjs/import-secret-key.md +8 -0
  359. package/dist/versions/v5/nextjs/import-sign-in-url.md +8 -0
  360. package/dist/versions/v5/nextjs/import-sign-up-url.md +8 -0
  361. package/dist/versions/v5/nextjs/isclerkapiresponserror-import-change.md +14 -0
  362. package/dist/versions/v5/nextjs/isemaillinkerror-import-change.md +14 -0
  363. package/dist/versions/v5/nextjs/isknownerror-import-change.md +14 -0
  364. package/dist/versions/v5/nextjs/min-nextjs-version.md +11 -0
  365. package/dist/versions/v5/nextjs/multisessionappsupport-import-change.md +14 -0
  366. package/dist/versions/v5/nextjs/next-public-clerk-js-url.md +7 -0
  367. package/dist/versions/v5/nextjs/redirect-import-change.md +14 -0
  368. package/dist/versions/v5/nextjs/redirecttosignin-import-path.md +13 -0
  369. package/dist/versions/v5/nextjs/redirecttosignup-import-path.md +13 -0
  370. package/dist/versions/v5/nextjs/signjwt-import-change.md +14 -0
  371. package/dist/versions/v5/nextjs/verifyjwt-import-change.md +14 -0
  372. package/dist/versions/v5/nextjs/verifytoken-import-change.md +14 -0
  373. package/dist/versions/v5/nextjs/with-clerk-middleware-removed.md +56 -0
  374. package/dist/versions/v5/node/cjs-esm-instance.md +1 -0
  375. package/dist/versions/v5/node/clerkexpressrequireauth-apikey.md +1 -0
  376. package/dist/versions/v5/node/clerkexpressrequireauth-frontendapi.md +1 -0
  377. package/dist/versions/v5/node/clerkexpresswithauth-apikey.md +1 -0
  378. package/dist/versions/v5/node/clerkexpresswithauth-frontendapi.md +1 -0
  379. package/dist/versions/v5/node/createclerkclient-apikey.md +1 -0
  380. package/dist/versions/v5/node/createclerkclient-frontendapi.md +1 -0
  381. package/dist/versions/v5/node/createclerkexpressrequireauth-apikey.md +1 -0
  382. package/dist/versions/v5/node/createclerkexpressrequireauth-frontendapi.md +1 -0
  383. package/dist/versions/v5/node/createclerkexpresswithauth-apikey.md +1 -0
  384. package/dist/versions/v5/node/createclerkexpresswithauth-frontendapi.md +1 -0
  385. package/dist/versions/v5/node/legacyauthobject-removed.md +3 -3
  386. package/dist/versions/v5/node/setclerkapikey.md +1 -0
  387. package/dist/versions/v5/node/setclerkapiversion.md +1 -0
  388. package/dist/versions/v5/node/setclerkhttpoptions.md +1 -0
  389. package/dist/versions/v5/node/setclerkserverapiurl.md +1 -0
  390. package/dist/versions/v5/react/api-url-value-change.md +1 -1
  391. package/dist/versions/v5/remix/clerk-import-change.md +1 -0
  392. package/dist/versions/v5/remix/clerkerrorboundary-removed.md +1 -0
  393. package/dist/versions/v5/remix/createclerkclient-apikey.md +1 -0
  394. package/dist/versions/v5/remix/getauth-apikey.md +1 -0
  395. package/dist/versions/v5/remix/rootauthloader-apikey.md +1 -0
  396. package/dist/versions/v5/remix/rootauthloader-frontendapi.md +1 -0
  397. package/package.json +5 -2
@@ -0,0 +1,580 @@
1
+ ---
2
+ title: "Upgrading Backend to Core 2"
3
+ description: "Learn how to upgrade Clerk's Backend SDK to the latest version."
4
+ ---
5
+
6
+ # Upgrading `@clerk/backend` to Core 2
7
+
8
+ Clerk's Core 2 release includes a new major version of the Backend SDK, v1. 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.
9
+
10
+ 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.
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/backend@core-1`). Some changes required for Core 2 can be applied incrementally to the latest v1 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 to Core 2 Beta
30
+
31
+ 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.
32
+
33
+ <CodeBlockTabs type="installer" options={["npm", "yarn", "pnpm"]}>
34
+ ```bash filename="terminal"
35
+ npm install @clerk/backend@beta
36
+ ```
37
+
38
+ ```bash filename="terminal"
39
+ yarn add @clerk/backend@beta
40
+ ```
41
+
42
+ ```bash filename="terminal"
43
+ pnpm add @clerk/backend@beta
44
+ ```
45
+
46
+ </CodeBlockTabs>
47
+
48
+ ## CLI Upgrade Helper
49
+
50
+ 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.
51
+
52
+ To run the CLI tool, navigate to your project and run it in the terminal:
53
+
54
+ <CodeBlockTabs type="installer" options={["npm", "yarn", "pnpm"]}>
55
+ ```bash filename="terminal"
56
+ npx @clerk/upgrade
57
+ ```
58
+
59
+ ```bash filename="terminal"
60
+ yarn dlx @clerk/upgrade
61
+ ```
62
+
63
+ ```bash filename="terminal"
64
+ pnpm dlx @clerk/upgrade
65
+ ```
66
+
67
+ </CodeBlockTabs>
68
+
69
+ 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.
70
+
71
+ ## Breaking Changes
72
+
73
+ ### `request` separated from `options` as params to `authenticateRequest`
74
+
75
+ There has been a change to the way the params of the `authenticateRequest` function are structured. The `request` param, formerly included in an `options` object, has been moved to stand on its own as the first param to the function, while the `options` object remains as the second param. Example below:
76
+
77
+ ```diff
78
+ - clerkClient.authenticateRequest({ ...opts, request })
79
+ + clerkClient.authenticateRequest(request, { ...opts })
80
+ ```
81
+
82
+ ### `clockSkewInSeconds` -> `clockSkewInMs`
83
+
84
+ The `clockSkewInSeconds` option has been renamed to `clockSkewInMs` in order to accurately reflect that its value is expected to be in milliseconds rather than seconds. The value does not need to change here, only the name. This change affects the following imports:
85
+
86
+ - `verifyJwt`
87
+ - `verifyToken`
88
+ - `Clerk.authenticateRequest`
89
+
90
+ ### Import paths changes
91
+
92
+ 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.
93
+
94
+ <Accordion titles={["<code>verifyJwt</code> import moved to <code>@clerk/backend/tokens</code>", "<code>decodeJwt</code> import moved to <code>@clerk/backend/tokens</code>", "<code>signJwt</code> import moved to <code>@clerk/backend/tokens</code>", "<code>constants</code> import moved to <code>@clerk/backend/internal</code>", "<code>redirect</code> import moved to <code>@clerk/backend/internal</code>", "<code>createAuthenticateRequest</code> import moved to <code>@clerk/backend/internal</code>", "<code>createIsomorphicRequest</code> import moved to <code>@clerk/backend/internal</code>", "<code>createIsomorphicRequest</code> import moved to <code>/internal</code>", "<code>SignJWTError</code> import moved to <code>@clerk/backend/errors</code>", "<code>TokenVerificationError</code> import moved to <code>@clerk/backend/errors</code>", "<code>TokenVerificationErrorAction</code> import moved to <code>@clerk/backend/errors</code>", "<code>TokenVerificationErrorReason</code> import moved to <code>@clerk/backend/errors</code>"]}>
95
+ <AccordionPanel>
96
+ The `verifyJwt` import path has changed from `@clerk/backend` to `@clerk/backend/tokens`. You must update your import path in order for it to work correctly. Example below of the fix that needs to be made
97
+
98
+ ```diff
99
+ - import { verifyJwt } from "@clerk/backend"
100
+ + import { verifyJwt } from "@clerk/backend/tokens"
101
+ ```
102
+ </AccordionPanel>
103
+ <AccordionPanel>
104
+ The `decodeJwt` import path has changed from `@clerk/backend` to `@clerk/backend/tokens`. You must update your import path in order for it to work correctly. Example below of the fix that needs to be made
105
+
106
+ ```diff
107
+ - import { decodeJwt } from "@clerk/backend"
108
+ + import { decodeJwt } from "@clerk/backend/tokens"
109
+ ```
110
+ </AccordionPanel>
111
+ <AccordionPanel>
112
+ The `signJwt` import path has changed from `@clerk/backend` to `@clerk/backend/tokens`. You must update your import path in order for it to work correctly. Example below of the fix that needs to be made
113
+
114
+ ```diff
115
+ - import { signJwt } from "@clerk/backend"
116
+ + import { signJwt } from "@clerk/backend/tokens"
117
+ ```
118
+ </AccordionPanel>
119
+ <AccordionPanel>
120
+ The `constants` import path has changed from `@clerk/backend` to `@clerk/backend/internal`. You must update your import path in order for it to work correctly. Note that internal imports are not intended for usage and are outside the scope of semver. Example below of the fix that needs to be made:
121
+
122
+ ```diff
123
+ - import { constants } from "@clerk/backend"
124
+ + import { constants } from "@clerk/backend/internal"
125
+ ```
126
+ </AccordionPanel>
127
+ <AccordionPanel>
128
+ The `redirect` import path has changed from `@clerk/backend` to `@clerk/backend/internal`. You must update your import path in order for it to work correctly. Note that internal imports are not intended for usage and are outside the scope of semver. Example below of the fix that needs to be made:
129
+
130
+ ```diff
131
+ - import { redirect } from "@clerk/backend"
132
+ + import { redirect } from "@clerk/backend/internal"
133
+ ```
134
+ </AccordionPanel>
135
+ <AccordionPanel>
136
+ The `createAuthenticateRequest` import path has changed from `@clerk/backend` to `@clerk/backend/internal`. You must update your import path in order for it to work correctly. Note that internal imports are not intended for usage and are outside the scope of semver. Example below of the fix that needs to be made:
137
+
138
+ ```diff
139
+ - import { createAuthenticateRequest } from "@clerk/backend"
140
+ + import { createAuthenticateRequest } from "@clerk/backend/internal"
141
+ ```
142
+ </AccordionPanel>
143
+ <AccordionPanel>
144
+ The `createIsomorphicRequest` import path has changed from `@clerk/backend` to `@clerk/backend/internal`. You must update your import path in order for it to work correctly. Note that internal imports are not intended for usage and are outside the scope of semver. Example below of the fix that needs to be made:
145
+
146
+ ```diff
147
+ - import { createIsomorphicRequest } from "@clerk/backend"
148
+ + import { createIsomorphicRequest } from "@clerk/backend/internal"
149
+ ```
150
+ </AccordionPanel>
151
+ <AccordionPanel>
152
+ The `createIsomorphicRequest` import was intended for those building custom Clerk integrations for frameworks and has been moved to `@clerk/backend/internal` to reflect this. Please use caution when using internal imports as they are outside the bounds of semver.
153
+
154
+ ```diff
155
+ - import { createIsomorphicRequest } from "@clerk/backend"
156
+ + import { createIsomorphicRequest } from "@clerk/backend/internal"
157
+ ```
158
+ </AccordionPanel>
159
+ <AccordionPanel>
160
+ The `SignJWTError` import path has changed from `@clerk/backend` to `@clerk/backend/errors`. You must update your import path in order for it to work correctly. Example below of the fix that needs to be made:
161
+
162
+ ```diff
163
+ - import { SignJWTError } from "@clerk/backend"
164
+ + import { SignJWTError } from "@clerk/backend/errors"
165
+ ```
166
+ </AccordionPanel>
167
+ <AccordionPanel>
168
+ The `TokenVerificationError` import path has changed from `@clerk/backend` to `@clerk/backend/errors`. You must update your import path in order for it to work correctly. Example below of the fix that needs to be made:
169
+
170
+ ```diff
171
+ - import { TokenVerificationError } from "@clerk/backend"
172
+ + import { TokenVerificationError } from "@clerk/backend/errors"
173
+ ```
174
+ </AccordionPanel>
175
+ <AccordionPanel>
176
+ The `TokenVerificationErrorAction` import path has changed from `@clerk/backend` to `@clerk/backend/errors`. You must update your import path in order for it to work correctly. Example below of the fix that needs to be made:
177
+
178
+ ```diff
179
+ - import { TokenVerificationErrorAction } from "@clerk/backend"
180
+ + import { TokenVerificationErrorAction } from "@clerk/backend/errors"
181
+ ```
182
+ </AccordionPanel>
183
+ <AccordionPanel>
184
+ The `TokenVerificationErrorReason` import path has changed from `@clerk/backend` to `@clerk/backend/errors`. You must update your import path in order for it to work correctly. Example below of the fix that needs to be made:
185
+
186
+ ```diff
187
+ - import { TokenVerificationErrorReason } from "@clerk/backend"
188
+ + import { TokenVerificationErrorReason } from "@clerk/backend/errors"
189
+ ```
190
+ </AccordionPanel>
191
+ </Accordion>
192
+
193
+ ### `httpOptions` parameter removed
194
+
195
+ The `httpOptions` parameter was removed from the internal `buildRequest` function but it is used by most public facing APIs. Hence you were able to pass `httpOptions` to some functions which is not possible anymore. If you're currently relying on this functionality and wish to update, please reach out to Clerk's support.
196
+
197
+ The internal change looks like this:
198
+
199
+ ```diff
200
+ - const r = buildRequest({ httpOptions: { headers: {} }})
201
+ + const request = buildRequest()
202
+ + request({ headerParams: {} })
203
+ ```
204
+
205
+ ### Removed: `orgs` claim on JWT
206
+
207
+ 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.
208
+
209
+ The `orgs` claim was part of the `JwtPayload`. Here are a few examples of where the `JwtPayload` could be found.
210
+
211
+ <Accordion titles={["Next.js", "Fastify", "@clerk/backend", "@clerk/clerk-sdk-node"]} heading="h5">
212
+ <AccordionPanel>
213
+ ```typescript filename="Next.js"
214
+ import { getAuth } from "@clerk/nextjs/server"
215
+ const claims: JwtPayload = getAuth(request).sessionClaims
216
+
217
+ import { getAuth } from "@clerk/ssr.server"
218
+ const claims: JwtPayload = (await getAuth(request)).sessionClaims
219
+ ```
220
+
221
+ </AccordionPanel>
222
+ <AccordionPanel>
223
+ ```typescript filename="Fastify"
224
+ import { getAuth } from "@clerk/fastify"
225
+ const claims: JwtPayload = (await getAuth(request)).sessionClaims
226
+ ```
227
+ </AccordionPanel>
228
+ <AccordionPanel>
229
+ ```typescript filename="@clerk/backend"
230
+ import { createClerkClient } from "@clerk/backend"
231
+
232
+ const clerkClient = createClerkClient({ secretKey: "" })
233
+ const requestState = await clerkClient.authenticateRequest(
234
+ request,
235
+ { publishableKey: "" }
236
+ )
237
+ const claims: JwtPayload = requestState.toAuth().sessionClaims
238
+ ```
239
+
240
+ </AccordionPanel>
241
+ <AccordionPanel>
242
+ ```typescript filename="@clerk/clerk-sdk-node"
243
+ import { clerkClient } from "@clerk/clerk-sdk-node"
244
+
245
+ router.use((...args) => clerkClient.expressRequireAuth()(...args))
246
+ router.get("/me", async (req, reply: Response) => {
247
+ return reply.json({ auth: req.auth })
248
+ })
249
+ ```
250
+
251
+ </AccordionPanel>
252
+ </Accordion>
253
+
254
+ 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.
255
+
256
+ ### Changes to pagination arguments for some functions
257
+
258
+ There were some changes made to pagination-related arguments passed into functions, in order to make it more clear how to control paginated results. See each function impacted by these changes below:
259
+
260
+ <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"]}>
261
+ <AccordionPanel>
262
+ 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:
263
+
264
+ ```diff
265
+ const { data } = await organization.getRoles({
266
+ - limit: 10,
267
+ + pageSize: 10,
268
+ - offset: 10,
269
+ + initialPage: 2,
270
+ })
271
+ ```
272
+ </AccordionPanel>
273
+ <AccordionPanel>
274
+ 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:
275
+
276
+ ```diff
277
+ const { data } = await organization.getMemberships({
278
+ - limit: 10,
279
+ + pageSize: 10,
280
+ - offset: 10,
281
+ + initialPage: 2,
282
+ })
283
+ ```
284
+ </AccordionPanel>
285
+ <AccordionPanel>
286
+ 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:
287
+
288
+ ```diff
289
+ const { data } = await organization.getDomains({
290
+ - limit: 10,
291
+ + pageSize: 10,
292
+ - offset: 10,
293
+ + initialPage: 2,
294
+ })
295
+ ```
296
+ </AccordionPanel>
297
+ <AccordionPanel>
298
+ 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:
299
+
300
+ ```diff
301
+ const { data } = await organization.getInvitations({
302
+ - limit: 10,
303
+ + pageSize: 10,
304
+ - offset: 10,
305
+ + initialPage: 2,
306
+ })
307
+ ```
308
+ </AccordionPanel>
309
+ <AccordionPanel>
310
+ 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:
311
+
312
+ ```diff
313
+ const { data } = await organization.getMembershipRequests({
314
+ - limit: 10,
315
+ + pageSize: 10,
316
+ - offset: 10,
317
+ + initialPage: 2,
318
+ })
319
+ ```
320
+ </AccordionPanel>
321
+ <AccordionPanel>
322
+ 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:
323
+
324
+ ```diff
325
+ const { data } = await user.getOrganizationInvitations({
326
+ - limit: 10,
327
+ + pageSize: 10,
328
+ - offset: 10,
329
+ + initialPage: 2,
330
+ })
331
+ ```
332
+ </AccordionPanel>
333
+ <AccordionPanel>
334
+ 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:
335
+
336
+ ```diff
337
+ const { data } = await user.getOrganizationSuggestions({
338
+ - limit: 10,
339
+ + pageSize: 10,
340
+ - offset: 10,
341
+ + initialPage: 2,
342
+ })
343
+ ```
344
+ </AccordionPanel>
345
+ <AccordionPanel>
346
+ 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:
347
+
348
+ ```diff
349
+ const { data } = await user.getOrganizationMemberships({
350
+ - limit: 10,
351
+ + pageSize: 10,
352
+ - offset: 10,
353
+ + initialPage: 2,
354
+ })
355
+ ```
356
+ </AccordionPanel>
357
+ </Accordion>
358
+
359
+ ### Changes to some function return signatures
360
+
361
+ There have been changes to return signatures for some functions. Since Clerk's API responses are paginated, the `totalCount` property is helpful in determining the total number of items in the response easily. This change also aligns the response shape with what is returned from the Clerk backend API. Each impacted function is listed below, along with code examples:
362
+
363
+ <Accordion titles={["<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>Users.getOrganizationMembershipList</code> return signature changed"]}>
364
+ <AccordionPanel>
365
+ 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.
366
+
367
+ Here's an example of how the response shape would change with this modification:
368
+
369
+ ```diff
370
+ - const data = await clerkClient.users.getOrganizationInvitationList()
371
+ + const { data, totalCount } = await clerkClient.users.getOrganizationInvitationList()
372
+ ```
373
+ </AccordionPanel>
374
+ <AccordionPanel>
375
+ 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:
376
+
377
+ ```diff
378
+ const data = await clerkClient.organizations.getOrganizationInvitationList({
379
+ organizationId: "...",
380
+ })
381
+
382
+ - data.forEach(() => {})
383
+ + data.data.forEach(() => {})
384
+ ```
385
+ </AccordionPanel>
386
+ <AccordionPanel>
387
+ 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:
388
+
389
+ ```diff
390
+ const { user } = useUser()
391
+ const membershipList = user.getOrganizationMembershipList()
392
+
393
+ - membershipList.forEach(() => {})
394
+ + membershipList.data.forEach(() => {})
395
+ ```
396
+ </AccordionPanel>
397
+ <AccordionPanel>
398
+ 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.
399
+
400
+ Here's an example of how the response shape would change with this modification:
401
+
402
+ ```diff
403
+ - const data = await clerkClient.users.getOrganizationList()
404
+ + const { data, totalCount } = await clerkClient.users.getOrganizationList()
405
+ ```
406
+ </AccordionPanel>
407
+ <AccordionPanel>
408
+ 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:
409
+
410
+ ```diff
411
+ const { organization } = useOrganization()
412
+ const orgList = organization.getOrganizationList()
413
+
414
+ - orgList.forEach(() => {})
415
+ + orgList.data.forEach(() => {})
416
+ ```
417
+ </AccordionPanel>
418
+ <AccordionPanel>
419
+ The response payload of `Users.getOrganizationMembershipList` 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.
420
+
421
+ Here's an example of how the response shape would change with this modification:
422
+
423
+ ```diff
424
+ - const data = await clerkClient.users.getOrganizationMembershipList()
425
+ + const { data, totalCount } = await clerkClient.users.getOrganizationMembershipList()
426
+ ```
427
+ </AccordionPanel>
428
+ </Accordion>
429
+
430
+ ### Image URL Name Consolidation
431
+
432
+ 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:
433
+
434
+ <Accordion titles={["<code>Organization.logoUrl</code> -&gt; <code>Organization.imageUrl</code>", "<code>User.profileImageUrl</code> -&gt; <code>.imageUrl</code>", "<code>ExternalAccount.picture</code> -&gt; <code>.imageUrl</code>", "<code>ExternalAccountJSON.avatar_url</code> -&gt; <code>.imageUrl</code>", "<code>OrganizationJSON.logo_url</code> -&gt; <code>.imageUrl</code>", "<code>UserJSON.profile_image_url</code> -&gt; <code>.imageUrl</code>", "<code>OrganizationMembershipPublicUserData.profileImageUrl</code> -&gt; <code>.imageUrl</code>", "<code>OrganizationMembershipPublicUserDataJSON.profile_image_url</code> -&gt; <code>.imageUrl</code>"]}>
435
+ <AccordionPanel>
436
+ The `logoUrl` property of any [`Organization` object](https://clerk.com/docs/references/javascript/organization/organization#organization) has been changed to `imageUrl`.
437
+ </AccordionPanel>
438
+ <AccordionPanel>
439
+ The `profileImageUrl` property of any `User` object has been changed to `imageUrl`.
440
+ </AccordionPanel>
441
+ <AccordionPanel>
442
+ The `picture` property of any [`ExternalAcccount` object](https://clerk.com/docs/references/javascript/external-account) has been changed to `imageUrl`.
443
+ </AccordionPanel>
444
+ <AccordionPanel>
445
+ The `avatarUrl` property of any `ExternalAcccountJSON` object has been changed to `imageUrl`.
446
+ </AccordionPanel>
447
+ <AccordionPanel>
448
+ The `logo_url` property of any `OrganizationJSON` object has been changed to `imageUrl`.
449
+ </AccordionPanel>
450
+ <AccordionPanel>
451
+ The `profile_image_url` property of any `UserJSON` object has been changed to `imageUrl`.
452
+ </AccordionPanel>
453
+ <AccordionPanel>
454
+ The `profileImageUrl` property of any `OrganizationMembershipPublicUserData` object has been changed to `imageUrl`.
455
+ </AccordionPanel>
456
+ <AccordionPanel>
457
+ The `profile_image_url` property of any `OrganizationMembershipPublicUserDataJSON` object has been changed to `imageUrl`.
458
+ </AccordionPanel>
459
+ </Accordion>
460
+
461
+ ### Deprecation removals & housekeeping
462
+
463
+ 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.
464
+
465
+ <Callout type='info'>
466
+ For this section more than any other one, please use the CLI upgrade tool (`npx @clerk/upgrade`). Changes in this
467
+ section are very unlikely to appear in your codebase, the tool will save time looking for them.
468
+ </Callout>
469
+
470
+ #### Deprecation removals
471
+
472
+ <Accordion titles={["<code>User.update({ password: &#39;x&#39; })</code> -&gt; <code>User.updatePassword(&#39;x&#39;)</code>", "<code>frontendApi</code> -&gt; <code>publishableKey</code> as param to createClerkClient", "<code>apiKey</code> -&gt; <code>secretKey</code> as param to createClerkClient"]}>
473
+ <AccordionPanel>
474
+ 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:
475
+
476
+ ```diff
477
+ - user.update({ password: 'foo' });
478
+
479
+ + user.updatePassword({
480
+ + currentPassword: 'bar',
481
+ + newPassword: 'foo',
482
+ + signOutOfOtherSessions: true,
483
+ + });
484
+ ```
485
+ </AccordionPanel>
486
+ <AccordionPanel>
487
+ The `frontendApi` argument passed to `createClerkClient` must be changed to `publishableKey`. Note that the values of the two keys are different, so both keys and values need to be changed. You can find your application's publishable key in the Clerk dashboard. Also note that the import value has changed for creating a new Clerk client, which will be addressed by a separate line item if relevant to your codebase.
488
+
489
+ ```diff
490
+ - import { Clerk } from '@clerk/backend';
491
+ + import { createClerkClient } from '@clerk/backend';
492
+
493
+ - const clerkClient = Clerk({ frontendApi: '...' });
494
+ + const clerkClient = createClerkClient({ publishableKey: '...' });
495
+
496
+ - clerkClient.authenticateRequest({ frontendApi: '...' });
497
+ + clerkClient.authenticateRequest({ publishableKey: '...' });
498
+ ```
499
+ </AccordionPanel>
500
+ <AccordionPanel>
501
+ The `apiKey` argument passed to `createClerkClient` must be changed to `secretKey`. Also note that the import value has changed for creating a new Clerk client, which will be addressed by a separate line item if relevant to your codebase.
502
+
503
+ ```diff
504
+ - import { Clerk } from '@clerk/backend';
505
+ + import { createClerkClient } from '@clerk/backend';
506
+
507
+ - const clerkClient = Clerk({ apiKey: '...' });
508
+ + const clerkClient = createClerkClient({ secretKey: '...' });
509
+
510
+ - clerkClient.authenticateRequest({ apiKey: '...' });
511
+ + clerkClient.authenticateRequest({ secretKey: '...' });
512
+ ```
513
+ </AccordionPanel>
514
+ </Accordion>
515
+
516
+ #### Other Breaking Changes
517
+
518
+ <Accordion titles={["<code>API_URL</code> value has changed", "<code>Clerk</code> -&gt; <code>createClerkClient</code>", "<code>pkgVersion</code> -&gt; <code>clerkJSVersion</code>", "<code>clerkClient.__unstable_options</code> removed", "<code>createEmail</code> import removed", "<code>MembershipRole</code> type replaced by <code>OrganizationCustomRoleKey</code> type", "<code>buildRequestUrl</code> import removed"]}>
519
+ <AccordionPanel>
520
+ The value of this export has changed from `https://api.clerk.dev` to `https://api.clerk.com`. If you were relying on the text content of this value not changing, you may need to make adjustments.
521
+ </AccordionPanel>
522
+ <AccordionPanel>
523
+ The top level `Clerk` import was renamed to `createClerkClient`. This is just a name change and can be treated as a text replacement, no changes to the params or return types.
524
+
525
+ ```js
526
+ // before
527
+ import { Clerk } from '@clerk/backend';
528
+
529
+ // after
530
+ import { createClerkClient } from '@clerk/backend';
531
+ ```
532
+ </AccordionPanel>
533
+ <AccordionPanel>
534
+ The `pkgVersion` parameter was removed from the `loadInterstitialFromLocal`, `loadInterstitialFromBAPI`, and `buildPublicInterstitialUrl` functions. Use `clerkJSVersion` instead. Example:
535
+
536
+ ```diff
537
+ - loadInterstitialFromLocal({ pkgVersion: "..." })
538
+ + loadInterstitialFromLocal({ clerkJSVersion: "..." })
539
+ ```
540
+ </AccordionPanel>
541
+ <AccordionPanel>
542
+ The `clerkClient.__unstable_options` property was removed. Previously, you could use it to update the internal options. Instead, create a new ` clerkClient` instance using `createClerkClient` and pass the options in this way. For example:
543
+
544
+ ```diff
545
+ import { createClerkClient } from "@clerk/backend"
546
+
547
+ const clerkClient = createClerkClient({ secretKey: "old" })
548
+
549
+ - clerkClient.__unstable_options.secretKey = "new"
550
+ + const newClerkClient = createClerkClient({ secretKey: "new" })
551
+ ```
552
+ </AccordionPanel>
553
+ <AccordionPanel>
554
+ The `createEmail` import has been removed. There is no replacement at this time because we need to rethink how `createEmail` behaves and align it with the newer `sendSms` method. If this is an issue for your implementation, please contact [Clerk support](https://clerk.com/contact).
555
+ </AccordionPanel>
556
+ <AccordionPanel>
557
+ The `MembershipRole` type was replaced with `OrganizationCustomRoleKey` (related to [roles and permissions](https://clerk.com/docs/organizations/roles-permissions)). An example of where this type might be found:
558
+
559
+ ```js
560
+ import { useAuth } from '@clerk/clerk-react';
561
+
562
+ const { orgRole } = useAuth();
563
+ ```
564
+
565
+ To support the existing roles `admin`, `basic_member`, and `guest_member` apply interface merging using the following snippet:
566
+
567
+ ```js
568
+ interface ClerkAuthorization {
569
+ permission: ''
570
+ role: 'admin' | 'basic_member' | 'guest_member'
571
+ }
572
+ ```
573
+ </AccordionPanel>
574
+ <AccordionPanel>
575
+ The `buildRequestUrl` import was intended for those building custom Clerk integrations for frameworks and has been removed in favor of other methods internally. If you were relying on this function and this is an issue, please [reach out to Clerk support](https://clerk.com/support).
576
+ </AccordionPanel>
577
+ </Accordion>
578
+
579
+
580
+
@@ -0,0 +1,3 @@
1
+ ## Some 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,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 = 'v5';
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
+ Clerk's Core 2 release includes a new major version of the Backend SDK, v1. 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,19 @@
1
+ import { accordionForCategory, assembleContent, deprecationRemovalsAndHousekeeping, frontmatter, loadVersionChangeData, markdown, markdownTemplate, singleItem, writeToFile } from '../../text-generation.js';
2
+ const version = 'v5';
3
+ const name = 'chrome-extension';
4
+ const properName = 'Chrome Extension';
5
+ const packageName = '@clerk/chrome-extension';
6
+ const cwd = `${version}/chromeExtension`;
7
+ async function generate() {
8
+ const data = loadVersionChangeData(version, name);
9
+ return assembleContent({
10
+ data,
11
+ cwd
12
+ }, [frontmatter({
13
+ title: `Upgrading ${properName} SDK from v4 to v5`,
14
+ description: `Learn how to upgrade Clerk's ${properName} SDK from v4 to v5.`
15
+ }), `# Upgrading \`${packageName}\` from v4 to v5`, markdown('intro'), markdown('prepare'), markdown('node-version'), markdown('react-version'), markdownTemplate('update-v5', {
16
+ packageName
17
+ }), markdown('cli'), '## Breaking Changes', singleItem('clerkprovider-tokencache'), markdown('redesign-preview'), markdown('after-sign-x-handling'), singleItem('navigate-to-routerpush-routerreplace'), markdown('orgs-claim'), markdown('path-routing'), markdown('image-url'), accordionForCategory('image-url'), deprecationRemovalsAndHousekeeping()]);
18
+ }
19
+ generate().then(writeToFile(cwd));
@@ -0,0 +1,3 @@
1
+ Version 5 of the Chrome Extension SDK 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` 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.