@clerk/upgrade 0.0.3 → 0.1.1

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 (164) hide show
  1. package/dist/app.js +10 -2
  2. package/dist/cli.js +19 -9
  3. package/dist/img/alternativemethods-backlink.png +0 -0
  4. package/dist/img/button-to-organizationlistcreateorganizationactionbutton.png +0 -0
  5. package/dist/img/connected-accounts-dropdown.png +0 -0
  6. package/dist/img/mfa-dropdown.png +0 -0
  7. package/dist/img/organizationprofile-settings.png +0 -0
  8. package/dist/img/remove-identitypreview-avatar.png +0 -0
  9. package/dist/img/remove-socialbuttonsblockbuttonarrow.png +0 -0
  10. package/dist/img/userbuttonpopoveractionbuttontext-removed.png +0 -0
  11. package/dist/img/userprofile-security.png +0 -0
  12. package/dist/scan.js +19 -7
  13. package/dist/util/expandable-list.js +3 -3
  14. package/dist/util/generate-export-change.js +10 -0
  15. package/dist/util/guess-framework.js +8 -3
  16. package/dist/util/load-change.js +2 -1
  17. package/dist/versions/v5/backend/api-url-value-changed.md +7 -0
  18. package/dist/versions/v5/backend/authenticaterequest-params-change.md +12 -0
  19. package/dist/versions/v5/backend/buildrequesturl-removed.md +7 -0
  20. package/dist/versions/v5/backend/clerk-import.md +2 -2
  21. package/dist/versions/v5/backend/client-unstableoptions-removed.md +15 -0
  22. package/dist/versions/v5/backend/clockskewinseconds.md +10 -2
  23. package/dist/versions/v5/backend/constants-import-path-move.md +13 -0
  24. package/dist/versions/v5/backend/createauthenticaterequest-import-path-move.md +13 -0
  25. package/dist/versions/v5/backend/createclerkclient-apikey.md +8 -11
  26. package/dist/versions/v5/backend/createclerkclient-frontendapi.md +7 -10
  27. package/dist/versions/v5/backend/createemail-removed.md +7 -0
  28. package/dist/versions/v5/backend/createisomorphicrequest-import-path-move.md +13 -0
  29. package/dist/versions/v5/backend/createisomorphicrequest-removed.md +13 -0
  30. package/dist/versions/v5/backend/decodeJwt-import-path-move.md +13 -0
  31. package/dist/versions/v5/backend/externalaccount-picture.md +6 -0
  32. package/dist/versions/v5/backend/externalaccountjson-avatarurl.md +6 -0
  33. package/dist/versions/v5/backend/getorganizationinvitationlist-return-signature.md +14 -0
  34. package/dist/versions/v5/backend/getorganizationlist-return-signature.md +14 -0
  35. package/dist/versions/v5/backend/getorganizationmembershiplist-return-signature.md +14 -0
  36. package/dist/versions/v5/backend/getpendingorganizationinvitationlist.md +5 -5
  37. package/dist/versions/v5/backend/httpoptions-removed.md +15 -0
  38. package/dist/versions/v5/backend/membershiprole.md +21 -0
  39. package/dist/versions/v5/backend/organization-logourl.md +6 -0
  40. package/dist/versions/v5/backend/organizationjson-logourl.md +6 -0
  41. package/dist/versions/v5/backend/organizationmembershippublicuserdata-profileimageurl.md +6 -0
  42. package/dist/versions/v5/backend/organizationmembershippublicuserdatajson-profileimageurl.md +6 -0
  43. package/dist/versions/v5/backend/pkgversion.md +15 -0
  44. package/dist/versions/v5/backend/redirect-import-path-move.md +13 -0
  45. package/dist/versions/v5/backend/return-signature-change.md +14 -0
  46. package/dist/versions/v5/backend/signjwt-import-path-move +0 -0
  47. package/dist/versions/v5/backend/signjwt-import-path-move.md +13 -0
  48. package/dist/versions/v5/backend/signjwterror-import-move.md +13 -0
  49. package/dist/versions/v5/backend/tokenverificationerror-import-move.md +13 -0
  50. package/dist/versions/v5/backend/tokenverificationerroraction-import-move.md +13 -0
  51. package/dist/versions/v5/backend/tokenverificationerrorcode-import-move.md +13 -0
  52. package/dist/versions/v5/backend/tokenverificationerrorreason-import-move.md +13 -0
  53. package/dist/versions/v5/backend/user-profileimageurl.md +6 -0
  54. package/dist/versions/v5/backend/userjson-profileimageurl.md +6 -0
  55. package/dist/versions/v5/backend/verifyjwt-import-path-move.md +13 -0
  56. package/dist/versions/v5/common/aftersigninouturl-behavior-change.md +7 -0
  57. package/dist/versions/v5/common/aftersigninurl-behavior-change +7 -0
  58. package/dist/versions/v5/common/aftersigninurl-behavior-change-2.md +7 -0
  59. package/dist/versions/v5/common/aftersigninurl-behavior-change.md +7 -0
  60. package/dist/versions/v5/common/aftersignouturl-behavior-change.md +7 -0
  61. package/dist/versions/v5/common/aftersignupurl-behavior-change.md +7 -0
  62. package/dist/versions/v5/common/afterswitchorganizationurl.md +2 -1
  63. package/dist/versions/v5/common/alternativemethods-backlink.md +18 -0
  64. package/dist/versions/v5/common/api-key-to-secret-key.md +1 -1
  65. package/dist/versions/v5/common/button-to-organizationlistcreateorganizationactionbutton.md +11 -0
  66. package/dist/versions/v5/common/card-changes.md +14 -0
  67. package/dist/versions/v5/common/changed-localization-keys.md +179 -0
  68. package/dist/versions/v5/common/clerkprovider-frontendapi-2.md +7 -0
  69. package/dist/versions/v5/common/clerkprovideroptionswrapper-dropped.md +6 -0
  70. package/dist/versions/v5/common/connected-accounts-dropdown.md +15 -0
  71. package/dist/versions/v5/common/emaillinkerrorcode-import-change.md +13 -0
  72. package/dist/versions/v5/common/external-account-avatarurl.md +7 -0
  73. package/dist/versions/v5/common/frontend-api-to-publishable-key.md +1 -1
  74. package/dist/versions/v5/common/isclerkapiresponserror-import-change.md +13 -0
  75. package/dist/versions/v5/common/isemaillinkerror-import-change.md +13 -0
  76. package/dist/versions/v5/common/isknownerror-import-change.md +13 -0
  77. package/dist/versions/v5/common/ismetamaskerror-import-change.md +13 -0
  78. package/dist/versions/v5/common/mfa-dropdown.md +11 -0
  79. package/dist/versions/v5/common/multi-session-ui-changes.md +0 -0
  80. package/dist/versions/v5/common/multisessionappsupport-import-change.md +12 -0
  81. package/dist/versions/v5/common/new-localization-keys.md +133 -0
  82. package/dist/versions/v5/common/organization-getdomains-arguments-change.md +20 -0
  83. package/dist/versions/v5/common/organization-getmembershiprequests-arguments-changed.md +20 -0
  84. package/dist/versions/v5/common/organization-getroles-arguments-changed.md +20 -0
  85. package/dist/versions/v5/common/organization-getroles-return-type.md +0 -0
  86. package/dist/versions/v5/common/organizationprofile-general.md +0 -0
  87. package/dist/versions/v5/common/organizationprofile-settings.md +12 -0
  88. package/dist/versions/v5/common/organizationswitcherpopoveractionbuttontext-removed.md +14 -0
  89. package/dist/versions/v5/common/remove-identitypreview-avatar.md +12 -0
  90. package/dist/versions/v5/common/remove-socialbuttonsblockbuttonarrow.md +10 -0
  91. package/dist/versions/v5/common/removed-localization-keys.md +166 -0
  92. package/dist/versions/v5/common/signoutcallback-to-redirecturl.md +22 -0
  93. package/dist/versions/v5/common/useorganization-invitationlist.md +1 -1
  94. package/dist/versions/v5/common/useorganization-membershiplist.md +2 -1
  95. package/dist/versions/v5/common/userbuttonpopoveractionbuttontext-removed.md +14 -0
  96. package/dist/versions/v5/common/userbuttonpopoveractionbuttontext.md +7 -0
  97. package/dist/versions/v5/common/userbuttontrigger-userbuttonbox-invert.md +12 -0
  98. package/dist/versions/v5/common/userprofile-prop.md +2 -1
  99. package/dist/versions/v5/common/userprofile-security.md +8 -0
  100. package/dist/versions/v5/common/withclerk-hof-removed.md +29 -0
  101. package/dist/versions/v5/common/withclerk-removed.md +16 -0
  102. package/dist/versions/v5/common/withsession-hof-removed.md +29 -0
  103. package/dist/versions/v5/common/withsession-removed.md +16 -0
  104. package/dist/versions/v5/common/withuser-hof-removed.md +29 -0
  105. package/dist/versions/v5/common/withuser-removed-2.md +18 -0
  106. package/dist/versions/v5/common/withuser-removed.md +16 -0
  107. package/dist/versions/v5/expo/apikey-to-publishable-key.md +1 -1
  108. package/dist/versions/v5/gatsby/apikey-to-publishable-key.md +1 -1
  109. package/dist/versions/v5/index.js +11 -22
  110. package/dist/versions/v5/js/aftersigninout-behavior-change.md +7 -0
  111. package/dist/versions/v5/js/aftersigninouturl-behavior-change.md +7 -0
  112. package/dist/versions/v5/js/aftersigninurl-behavior-change.md +0 -0
  113. package/dist/versions/v5/js/clerk-isready-removed.md +6 -0
  114. package/dist/versions/v5/js/organization-getdomains-arguments-change.md +20 -0
  115. package/dist/versions/v5/js/organization-getinvitations-arguments-changed.md +20 -0
  116. package/dist/versions/v5/js/organization-getmembershiprequests-arguments-changed.md +20 -0
  117. package/dist/versions/v5/js/organization-getmemberships-arguments-changed.md +20 -0
  118. package/dist/versions/v5/js/organization-getroles-arguments-changed.md +20 -0
  119. package/dist/versions/v5/js/user-getorganizationinvitations-arguments-chanaged.md +20 -0
  120. package/dist/versions/v5/js/user-getorganizationmemberships-arguments-chanaged +0 -0
  121. package/dist/versions/v5/js/user-getorganizationmemberships-arguments-chanaged.md +20 -0
  122. package/dist/versions/v5/js/user-getorganizationsuggestions-arguments-chanaged.md +20 -0
  123. package/dist/versions/v5/next/api-url-value-change.md +1 -0
  124. package/dist/versions/v5/next/auth-import-change.md +13 -0
  125. package/dist/versions/v5/next/auth-middleware-deprecated.md +43 -4
  126. package/dist/versions/v5/next/authmiddleware-import-change.md +13 -0
  127. package/dist/versions/v5/next/buildclerkprops-import-change.md +13 -0
  128. package/dist/versions/v5/next/clerk-import-change.md +12 -0
  129. package/dist/versions/v5/next/clerk-js-version-next-public.md +1 -1
  130. package/dist/versions/v5/next/constants-import-change.md +13 -0
  131. package/dist/versions/v5/next/createauthenticaterequest-import-change.md +13 -0
  132. package/dist/versions/v5/next/createisomorphicrequest-import-change.md +13 -0
  133. package/dist/versions/v5/next/currentuser-import-change.md +13 -0
  134. package/dist/versions/v5/next/decodejwt-import-change.md +13 -0
  135. package/dist/versions/v5/next/emaillinkerrorcode-import-change.md +13 -0
  136. package/dist/versions/v5/next/import-sign-up-url.md +1 -0
  137. package/dist/versions/v5/next/isclerkapiresponserror-import-change.md +13 -0
  138. package/dist/versions/v5/next/isemaillinkerror-import-change.md +13 -0
  139. package/dist/versions/v5/next/isknownerror-import-change.md +13 -0
  140. package/dist/versions/v5/next/ismetamaskerror-import-change.md +13 -0
  141. package/dist/versions/v5/next/min-nextjs-version.md +9 -0
  142. package/dist/versions/v5/next/multisessionappsupport-import-change.md +13 -0
  143. package/dist/versions/v5/next/next-public-clerk-js-url.md +6 -0
  144. package/dist/versions/v5/next/redirect-import-change.md +13 -0
  145. package/dist/versions/v5/next/signjwt-import-change.md +13 -0
  146. package/dist/versions/v5/next/verify +0 -0
  147. package/dist/versions/v5/next/verifyjwt-import-change.md +13 -0
  148. package/dist/versions/v5/next/verifytoken-import-change.md +13 -0
  149. package/dist/versions/v5/next/withclerk-removed.md +15 -0
  150. package/dist/versions/v5/next/withsession-removed.md +15 -0
  151. package/dist/versions/v5/next/withuser-removed.md +0 -0
  152. package/dist/versions/v5/node/legacyauthobject-removed.md +26 -0
  153. package/dist/versions/v5/react/router-navigate.md +18 -0
  154. package/dist/versions/v5/react/signoutcallback-to- +0 -0
  155. package/dist/versions/v5/react/signoutcallback-to-redirecturl.md +22 -0
  156. package/dist/versions/v5/remix/clerkerrorboundary-removed.md +22 -0
  157. package/dist/versions/v5/remix/clerkprovider-frontendapi.md +0 -0
  158. package/dist/versions/v5/remix/createclerkclient-apikey.md +14 -0
  159. package/dist/versions/v5/remix/getauth-apikey.md +16 -0
  160. package/dist/versions/v5/remix/rootauthloader-apikey.md +14 -0
  161. package/dist/versions/v5/remix/rootauthloader-frontendapi.md +14 -0
  162. package/dist/versions/v5/shared/buildrequesturl.md +6 -8
  163. package/dist/versions/v5/shared/getrequesturl.md +6 -0
  164. package/package.json +1 -1
package/dist/app.js CHANGED
@@ -13,8 +13,11 @@ export default function App({
13
13
  _toVersion,
14
14
  _sdk,
15
15
  _dir = false,
16
- _ignore = []
16
+ _ignore = [],
17
+ _yolo = false,
18
+ noWarnings = false
17
19
  }) {
20
+ const [yolo, setYolo] = useState(_yolo);
18
21
  const [sdks, setSdks] = useState(_sdk ? [_sdk] : []);
19
22
  const [sdkGuesses, setSdkGuesses] = useState([]);
20
23
  const [sdkGuessConfirmed, setSdkGuessConfirmed] = useState(false);
@@ -27,6 +30,10 @@ export default function App({
27
30
  const [configComplete, setConfigComplete] = useState(false);
28
31
  const [configVerified, setConfigVerified] = useState(false);
29
32
  let fromVersionGuess = false;
33
+ if (yolo) {
34
+ setSdks(SDKS.map(s => s.value));
35
+ setYolo(false);
36
+ }
30
37
 
31
38
  // We try to guess which SDK they are using
32
39
  if (isEmpty(sdks) && isEmpty(sdkGuesses) && !sdkGuessAttempted) {
@@ -126,7 +133,8 @@ export default function App({
126
133
  toVersion,
127
134
  sdks,
128
135
  dir,
129
- ignore
136
+ ignore,
137
+ noWarnings
130
138
  })));
131
139
  }
132
140
 
package/dist/cli.js CHANGED
@@ -9,15 +9,15 @@ const cli = meow(`
9
9
  $ clerk-upgrade
10
10
 
11
11
  Options
12
- --from Major version number you're upgrading from
13
- --to Major version number you're upgrading to
14
- --sdk Name of the SDK you're upgrading
15
- --dir Directory you'd like to scan for files
16
- --ignore Any files or directories you'd like to ignore
12
+ --from Major version number you're upgrading from
13
+ --to Major version number you're upgrading to
14
+ --sdk Name of the SDK you're upgrading
15
+ --dir Directory you'd like to scan for files
16
+ --ignore Any files or directories you'd like to ignore
17
+ --noWarnings Do not print warnings, only items that must be fixed
17
18
 
18
19
  Examples
19
- $ clerk-upgrade --from=4 --to=5 --sdk=nextjs --dir=src/**
20
- Hello, Jane
20
+ $ clerk-upgrade --sdk=nextjs --dir=src/**
21
21
  `, {
22
22
  importMeta: import.meta,
23
23
  flags: {
@@ -39,6 +39,12 @@ const cli = meow(`
39
39
  ignore: {
40
40
  type: 'string',
41
41
  isMultiple: true
42
+ },
43
+ yolo: {
44
+ type: 'boolean'
45
+ },
46
+ noWarnings: {
47
+ type: 'boolean'
42
48
  }
43
49
  }
44
50
  });
@@ -46,5 +52,9 @@ render( /*#__PURE__*/React.createElement(App, {
46
52
  _fromVersion: cli.flags.from,
47
53
  _toVersion: cli.flags.to,
48
54
  _sdk: cli.flags.sdk,
49
- _dir: cli.flags.dir
50
- }));
55
+ _dir: cli.flags.dir,
56
+ _yolo: cli.flags.yolo,
57
+ noWarnings: cli.flags.noWarnings
58
+ })
59
+ // { debug: true }, if having issues with errors being swallowed, uncomment this
60
+ );
Binary file
package/dist/scan.js CHANGED
@@ -11,7 +11,8 @@ export default function Scan({
11
11
  toVersion,
12
12
  sdks,
13
13
  dir,
14
- ignore
14
+ ignore,
15
+ noWarnings
15
16
  }) {
16
17
  // NOTE: if the difference between fromVersion and toVersion is greater than 1
17
18
  // we need to do a little extra work here and import two matchers,
@@ -73,18 +74,29 @@ export default function Scan({
73
74
  // then we run each of the matchers against the file contents
74
75
  for (const sdk in matchers) {
75
76
  // returns [{ ...matcher, instances: [{sdk, file, position}] }]
76
- matchers[sdk].map(matcher => {
77
+ matchers[sdk].map(matcherConfig => {
77
78
  // run regex against file content, return array of matches
78
- const matches = Array.from(content.matchAll(matcher.matcher));
79
+ // matcher can be an array or string
80
+ let matches = [];
81
+ if (Array.isArray(matcherConfig.matcher)) {
82
+ matcherConfig.matcher.map(m => {
83
+ matches = matches.concat(Array.from(content.matchAll(m)));
84
+ });
85
+ } else {
86
+ matches = Array.from(content.matchAll(matcherConfig.matcher));
87
+ }
79
88
  if (matches.length < 1) return;
80
89
 
81
90
  // for each match, add to `instances` array of a key, create if not exists
82
91
  matches.map(match => {
83
- if (!allResults[matcher.title]) allResults[matcher.title] = {
92
+ if (noWarnings && matcherConfig.warning) return;
93
+ if (!allResults[matcherConfig.title]) allResults[matcherConfig.title] = {
84
94
  instances: [],
85
- ...matcher
95
+ ...matcherConfig
86
96
  };
87
- allResults[matcher.title].instances.push({
97
+
98
+ // TODO: there's a small bug where we can see multiple instances of the same position
99
+ allResults[matcherConfig.title].instances.push({
88
100
  sdk,
89
101
  file: path.relative(process.cwd(), file),
90
102
  position: indexToPosition(content, match.index, {
@@ -99,7 +111,7 @@ export default function Scan({
99
111
  })).then(() => {
100
112
  setResults([...results, ...Object.keys(allResults).map(k => allResults[k])]);
101
113
  setComplete(true);
102
- if (results.length < 1) {
114
+ if (Object.keys(allResults).length < 1) {
103
115
  setStatus('It looks like you have nothing you need to change, upgrade away!');
104
116
  } else {
105
117
  setStatus('File scan complete. See results below!');
@@ -59,9 +59,9 @@ export default function ExpandableList({
59
59
  borderColor: item.focused ? 'blue' : 'white',
60
60
  paddingX: 1,
61
61
  key: item.title
62
- }, /*#__PURE__*/React.createElement(Markdown, null, item.title), locations.length > 1 ? /*#__PURE__*/React.createElement(Text, null, "Found ", locations.length, " instances, expand for detail") : /*#__PURE__*/React.createElement(Text, null, "Location: ", locations[0]), item.expanded && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Line, null), locations.length > 1 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, null, "Locations:"), locations.map(loc => /*#__PURE__*/React.createElement(Text, null, ' ', "- ", loc))), /*#__PURE__*/React.createElement(Newline, null), /*#__PURE__*/React.createElement(Markdown, null, item.content), /*#__PURE__*/React.createElement(Line, null), /*#__PURE__*/React.createElement(Link, {
63
- url: item.link
64
- }, /*#__PURE__*/React.createElement(Text, null, "Open in migration guide \xBB")))));
62
+ }, /*#__PURE__*/React.createElement(Markdown, null, item.title), locations.length > 1 ? /*#__PURE__*/React.createElement(Text, null, "Found ", locations.length, " instances, expand for detail") : /*#__PURE__*/React.createElement(Text, null, "Location: ", locations[0]), item.expanded && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Line, null), locations.length > 1 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, null, "Locations:"), locations.map(loc => /*#__PURE__*/React.createElement(Text, null, ' ', "- ", loc)), /*#__PURE__*/React.createElement(Line, null)), item.warning && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
63
+ color: "yellow"
64
+ }, "\u26A0\uFE0F This is a WARNING and will still match even if you corrected the issue or if no correction is necessary. To dismiss warnings, pass the `--noWarnings` flag to the CLI when running."), /*#__PURE__*/React.createElement(Line, null)), /*#__PURE__*/React.createElement(Newline, null), /*#__PURE__*/React.createElement(Markdown, null, item.content))));
65
65
  return memo;
66
66
  }, []), state.all.length > state.numberVisible && /*#__PURE__*/React.createElement(Text, null, "Showing ", state.visible[0] + 1, " - ", Math.min(state.visible[1], state.all.length), " of ", state.all.length));
67
67
  }
@@ -0,0 +1,10 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+
4
+ // WIP, a util script used for quickly generating a large number of nearly identical change files
5
+ const movedToServer = ['MultisessionAppSupport', 'auth', 'currentUser', 'authMiddleware',
6
+ // deprecated
7
+ 'clerkMiddleware',
8
+ // new
9
+ 'redirectToSignIn', 'redirectToSignUp', 'buildClerkProps', 'verifyToken', 'isClerkAPIResponseError', 'isEmailLinkError', 'isKnownError', 'isMetamaskError', 'EmailLinkErrorCode', 'withClerk', 'withSession', 'withUser', 'WithClerk', 'WithSession', 'WithUser'];
10
+ const clerkBackendExports = ['createClerkClient', 'verifyToken'];
@@ -1,9 +1,14 @@
1
1
  import { readPackageSync } from 'read-pkg';
2
2
  import SDKS from '../constants/sdks.js';
3
3
  export default function guessFrameworks(dir) {
4
- const pkg = readPackageSync({
5
- cwd: dir
6
- });
4
+ let pkg;
5
+ try {
6
+ pkg = readPackageSync({
7
+ cwd: dir
8
+ });
9
+ } catch (err) {
10
+ return [];
11
+ }
7
12
 
8
13
  // no guessing if there are no deps
9
14
  if (!pkg.dependencies && !pkg.devDependencies) return [];
@@ -19,11 +19,12 @@ export default function createLoader({
19
19
  const fm = parsed.data;
20
20
  return {
21
21
  title: fm.title,
22
- matcher: new RegExp(fm.matcher, `g${fm.matcherFlags ? fm.matcherFlags : ''}`),
22
+ matcher: Array.isArray(fm.matcher) ? fm.matcher.map(m => new RegExp(m, `g${fm.matcherFlags ? fm.matcherFlags : ''}`)) : new RegExp(fm.matcher, `g${fm.matcherFlags ? fm.matcherFlags : ''}`),
23
23
  replaceWithString: fm.replaceWithString,
24
24
  slug,
25
25
  sdk: sdk,
26
26
  content: parsed.content,
27
+ warning: fm.warning,
27
28
  link: `${baseUrl}#${slug}`
28
29
  };
29
30
  });
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: '`API_URL` value has changed'
3
+ matcher: "API_URL[\\s\\S]*?from\\s+['\"]@clerk\\/backend\\/constants['\"]"
4
+ matcherFlags: 'm'
5
+ ---
6
+
7
+ 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.
@@ -0,0 +1,12 @@
1
+ ---
2
+ title: '`request` separated from `options` as params to `authenticateRequest`'
3
+ warning: true
4
+ matcher: "authenticateRequest\\("
5
+ ---
6
+
7
+ 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:
8
+
9
+ ```diff
10
+ - clerkClient.authenticateRequest({ ...opts, request })
11
+ + clerkClient.authenticateRequest(request, { ...opts })
12
+ ```
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: '`buildRequestUrl` import removed'
3
+ matcher: "import\\s+{[\\s\\S]*?buildRequestUrl[\\s\\S]*?}\\s+from\\s+['\"]@clerk\/backend['\"]"
4
+ matcherFlags: 'm'
5
+ ---
6
+
7
+ 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).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: '`Clerk` -> `createClerkClient`'
3
- matcher: "import\\s+{[\\s\\S]*?Clerk[\\s\\S]*?}\\s+from\\s+['\"]@clerk/backend['\"]"
3
+ matcher: "import\\s+{*[\\s\\S]*?Clerk[\\s\\S]*?}*\\s+from\\s+['\"]@clerk\\/backend['\"]"
4
4
  matcherFlags: 'm'
5
5
  ---
6
6
 
@@ -8,7 +8,7 @@ The top level `Clerk` import was renamed to `createClerkClient`. This is just a
8
8
 
9
9
  ```js
10
10
  // before
11
- import { Clerk } from '@clerk/backend';
11
+ import Clerk from '@clerk/backend';
12
12
 
13
13
  // after
14
14
  import { createClerkClient } from '@clerk/backend';
@@ -0,0 +1,15 @@
1
+ ---
2
+ title: '`clerkClient.__unstable_options` removed'
3
+ matcher: "\\.__unstable_options"
4
+ ---
5
+
6
+ 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:
7
+
8
+ ```diff
9
+ import { createClerkClient } from "@clerk/backend"
10
+
11
+ const clerkClient = createClerkClient({ secretKey: "old" })
12
+
13
+ - clerkClient.__unstable_options.secretKey = "new"
14
+ + const newClerkClient = createClerkClient({ secretKey: "new" })
15
+ ```
@@ -1,7 +1,15 @@
1
1
  ---
2
2
  title: '`clockSkewInSeconds` -> `clockSkewInMs`'
3
- matcher: 'clockSkewInSeconds'
3
+ matcher:
4
+ - "verifyJwt\\([\\s\\S]*?(clockSkewInSeconds):[\\s\\S]*?\\)"
5
+ - "verifyToken\\([\\s\\S]*?(clockSkewInSeconds):[\\s\\S]*?\\)"
6
+ - "authenticateRequest\\([\\s\\S]*?(clockSkewInSeconds):[\\s\\S]*?\\)"
7
+ matcherFlags: 'm'
4
8
  replaceWithString: 'clockSkewInMs'
5
9
  ---
6
10
 
7
- The value stayed the same, only the name changed.
11
+ 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:
12
+
13
+ - `verifyJwt`
14
+ - `verifyToken`
15
+ - `Clerk.authenticateRequest`
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: '`constants` import moved to `@clerk/backend/internal`'
3
+ matcher: "import\\s+{[\\s\\S]*?constants[\\s\\S]*?}\\s+from\\s+['\"]@clerk\\/(backend)['\"]"
4
+ matcherFlags: 'm'
5
+ replaceWithString: 'backend/internal'
6
+ ---
7
+
8
+ 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:
9
+
10
+ ```diff
11
+ - import { constants } from "@clerk/backend"
12
+ + import { constants } from "@clerk/backend/internal"
13
+ ```
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: '`createAuthenticateRequest` import moved to `@clerk/backend/internal`'
3
+ matcher: "import\\s+{[\\s\\S]*?createAuthenticateRequest[\\s\\S]*?}\\s+from\\s+['\"]@clerk\\/(backend)['\"]"
4
+ matcherFlags: 'm'
5
+ replaceWithString: 'backend/internal'
6
+ ---
7
+
8
+ 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:
9
+
10
+ ```diff
11
+ - import { createAuthenticateRequest } from "@clerk/backend"
12
+ + import { createAuthenticateRequest } from "@clerk/backend/internal"
13
+ ```
@@ -1,21 +1,18 @@
1
1
  ---
2
2
  title: '`apiKey` -> `secretKey` as param to createClerkClient'
3
- matcher: "[createClerkClient|Clerk]\\(\\s*{[\\s\\S]*?frontendApi:[\\s\\S]*?\\)"
3
+ matcher: "(?:createClerkClient|Clerk)\\(\\s*{[\\s\\S]*?frontendApi:[\\s\\S]*?\\)"
4
4
  matcherFlags: 'm'
5
5
  ---
6
6
 
7
7
  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.
8
8
 
9
- ```js
10
- // before
11
- import { Clerk } from '@clerk/backend';
9
+ ```diff
10
+ - import { Clerk } from '@clerk/backend';
11
+ + import { createClerkClient } from '@clerk/backend';
12
12
 
13
- const clerkClient = Clerk({ apiKey: '...' });
14
- clerkClient.authenticateRequest({ apiKey: '...' });
13
+ - const clerkClient = Clerk({ apiKey: '...' });
14
+ + const clerkClient = createClerkClient({ secretKey: '...' });
15
15
 
16
- // after
17
- import { createClerkClient } from '@clerk/backend';
18
-
19
- const clerkClient = createClerkClient({ secretKey: '...' });
20
- clerkClient.authenticateRequest({ secretKey: '...' });
16
+ - clerkClient.authenticateRequest({ apiKey: '...' });
17
+ + clerkClient.authenticateRequest({ secretKey: '...' });
21
18
  ```
@@ -6,16 +6,13 @@ matcherFlags: 'm'
6
6
 
7
7
  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.
8
8
 
9
- ```js
10
- // before
11
- import { Clerk } from '@clerk/backend';
9
+ ```diff
10
+ - import { Clerk } from '@clerk/backend';
11
+ + import { createClerkClient } from '@clerk/backend';
12
12
 
13
- const clerkClient = Clerk({ frontendApi: '...' });
14
- clerkClient.authenticateRequest({ frontendApi: '...' });
13
+ - const clerkClient = Clerk({ frontendApi: '...' });
14
+ + const clerkClient = createClerkClient({ publishableKey: '...' });
15
15
 
16
- // after
17
- import { createClerkClient } from '@clerk/backend';
18
-
19
- const clerkClient = createClerkClient({ publishableKey: '...' });
20
- clerkClient.authenticateRequest({ publishableKey: '...' });
16
+ - clerkClient.authenticateRequest({ frontendApi: '...' });
17
+ + clerkClient.authenticateRequest({ publishableKey: '...' });
21
18
  ```
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: '`createEmail` import removed'
3
+ matcher: "import\\s+{[\\s\\S]*?createEmail[\\s\\S]*?}\\s+from\\s+['\"]@clerk\/backend['\"]"
4
+ matcherFlags: 'm'
5
+ ---
6
+
7
+ 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).
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: '`createIsomorphicRequest` import moved to `@clerk/backend/internal`'
3
+ matcher: "import\\s+{[\\s\\S]*?createIsomorphicRequest[\\s\\S]*?}\\s+from\\s+['\"]@clerk\\/(backend)['\"]"
4
+ matcherFlags: 'm'
5
+ replaceWithString: 'backend/internal'
6
+ ---
7
+
8
+ 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:
9
+
10
+ ```diff
11
+ - import { createIsomorphicRequest } from "@clerk/backend"
12
+ + import { createIsomorphicRequest } from "@clerk/backend/internal"
13
+ ```
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: '`createIsomorphicRequest` import moved to `/internal`'
3
+ matcher: "import\\s+{[\\s\\S]*?createIsomorphicRequest[\\s\\S]*?}\\s+from\\s+['\"]@clerk\/(backend)['\"]"
4
+ replaceWithString: 'backend/internal'
5
+ matcherFlags: 'm'
6
+ ---
7
+
8
+ 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.
9
+
10
+ ```diff
11
+ - import { createIsomorphicRequest } from "@clerk/backend"
12
+ + import { createIsomorphicRequest } from "@clerk/backend/internal"
13
+ ```
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: '`decodeJwt` import moved to `@clerk/backend/tokens`'
3
+ matcher: "import\\s+{[\\s\\S]*?decodeJwt[\\s\\S]*?}\\s+from\\s+['\"]@clerk\\/(backend)['\"]"
4
+ matcherFlags: 'm'
5
+ replaceWithString: 'backend/tokens'
6
+ ---
7
+
8
+ 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
9
+
10
+ ```diff
11
+ - import { decodeJwt } from "@clerk/backend"
12
+ + import { decodeJwt } from "@clerk/backend/tokens"
13
+ ```
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: '`ExternalAccount.picture` -> `.imageUrl`'
3
+ matcher: "\\.picture"
4
+ ---
5
+
6
+ The `picture` property of any [`ExternalAcccount` object](https://clerk.com/docs/references/javascript/external-account) has been changed to `imageUrl`.
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: '`ExternalAccountJSON.avatar_url` -> `.imageUrl`'
3
+ matcher: "\\.avatar_url"
4
+ ---
5
+
6
+ The `avatarUrl` property of any `ExternalAcccountJSON` object has been changed to `imageUrl`.
@@ -0,0 +1,14 @@
1
+ ---
2
+ title: '`Users.getOrganizationInvitationList` return signature changed'
3
+ matcher: "\\.users\\.getOrganizationInvitationList\\("
4
+ warning: true
5
+ ---
6
+
7
+ 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.
8
+
9
+ Here's an example of how the response shape would change with this modification:
10
+
11
+ ```diff
12
+ - const data = await clerkClient.users.getOrganizationInvitationList()
13
+ + const { data, totalCount } = await clerkClient.users.getOrganizationInvitationList()
14
+ ```
@@ -0,0 +1,14 @@
1
+ ---
2
+ title: '`Users.getOrganizationList` return signature changed'
3
+ matcher: "\\.users\\.getOrganizationList\\("
4
+ warning: true
5
+ ---
6
+
7
+ 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.
8
+
9
+ Here's an example of how the response shape would change with this modification:
10
+
11
+ ```diff
12
+ - const data = await clerkClient.users.getOrganizationList()
13
+ + const { data, totalCount } = await clerkClient.users.getOrganizationList()
14
+ ```
@@ -0,0 +1,14 @@
1
+ ---
2
+ title: '`Users.getOrganizationMembershipList` return signature changed'
3
+ matcher: "\\.users\\.getOrganizationMembershipList\\("
4
+ warning: true
5
+ ---
6
+
7
+ 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.
8
+
9
+ Here's an example of how the response shape would change with this modification:
10
+
11
+ ```diff
12
+ - const data = await clerkClient.users.getOrganizationMembershipList()
13
+ + const { data, totalCount } = await clerkClient.users.getOrganizationMembershipList()
14
+ ```
@@ -1,12 +1,12 @@
1
1
  ---
2
- title: '`getPendingOrganizationInvitationList` -> `getOrganizationInvitationList`'
3
- matcher: 'getPendingOrganizationInvitationList'
2
+ title: '`Organizations.getPendingOrganizationInvitationList` -> `getOrganizationInvitationList`'
3
+ matcher: "\\.(getPendingOrganizationInvitationList)\\("
4
4
  replaceWithString: 'getOrganizationInvitationList'
5
5
  ---
6
6
 
7
- Use `getOrganizationInvitationList` with a `status` option instead.
7
+ The `Organizations.getPendingOrganizationInvitationList` method has been removed. To match the same functionality, use `Organizations.getOrganizationInvitationList` and pass in `status` option as "pending" instead.
8
8
 
9
9
  ```diff
10
- - getPendingOrganizationInvitationList({ organizationId: "" })
11
- + getOrganizationInvitationList({ organizationId: "", status: "pending" })
10
+ - clerkClient.organizations.getPendingOrganizationInvitationList()
11
+ + clerkClient.organizations.getOrganizationInvitationList({ status: "pending" })
12
12
  ```
@@ -0,0 +1,15 @@
1
+ ---
2
+ title: '`httpOptions` parameter removed'
3
+ matcher: "\\([\\s\\S]*?httpOptions:\\s\\S]*?\\)"
4
+ matcherFlags: 'm'
5
+ ---
6
+
7
+ 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.
8
+
9
+ The internal change looks like this:
10
+
11
+ ```diff
12
+ - const r = buildRequest({ httpsOptions: { headers: {} }})
13
+ + const request = buildRequest()
14
+ + request({ headerParams: {} })
15
+ ```
@@ -0,0 +1,21 @@
1
+ ---
2
+ title: '`MembershipRole` type replaced by `OrganizationCustomRoleKey` type'
3
+ matcher: "(?:\\.orgRole|\\.org_role)"
4
+ ---
5
+
6
+ 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:
7
+
8
+ ```js
9
+ import { useAuth } from '@clerk/clerk-react';
10
+
11
+ const { orgRole } = useAuth();
12
+ ```
13
+
14
+ To support the existing roles `admin`, `basic_member`, and `guest_member` apply interface merging using the following snippet:
15
+
16
+ ```js
17
+ interface ClerkAuthorization {
18
+ permission: ''
19
+ role: 'admin' | 'basic_member' | 'guest_member'
20
+ }
21
+ ```
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: '`Organization.logoUrl` -> `.imageUrl`'
3
+ matcher: "\\.logoUrl"
4
+ ---
5
+
6
+ The `logoUrl` property of any `Organization` object has been changed to `imageUrl`.
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: '`OrganizationJSON.logo_url` -> `.imageUrl`'
3
+ matcher: "\\.logo_url"
4
+ ---
5
+
6
+ The `logo_url` property of any `OrganizationJSON` object has been changed to `imageUrl`.
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: '`OrganizationMembershipPublicUserData.profileImageUrl` -> `.imageUrl`'
3
+ matcher: "\\.profileImageUrl"
4
+ ---
5
+
6
+ The `profileImageUrl` property of any `OrganizationMembershipPublicUserData` object has been changed to `imageUrl`.
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: '`OrganizationMembershipPublicUserDataJSON.profile_image_url` -> `.imageUrl`'
3
+ matcher: "\\.profile_image_url"
4
+ ---
5
+
6
+ The `profile_image_url` property of any `OrganizationMembershipPublicUserDataJSON` object has been changed to `imageUrl`.
@@ -0,0 +1,15 @@
1
+ ---
2
+ title: '`pkgVersion` -> `clerkJSVersion`'
3
+ matcher:
4
+ - "loadInterstitialFromLocal\\([\\s\\S]*?pkgVersion:"
5
+ - "loadInterstitialFromBAPI\\([\\s\\S]*?pkgVersion:"
6
+ - "buildPublicInterstitialUrl\\([\\s\\S]*?pkgVersion:"
7
+ matcherFlags: 'm'
8
+ ---
9
+
10
+ The `pkgVersion` parameter was removed from the `loadInterstitialFromLocal`, `loadInterstitialFromBAPI`, and `buildPublicInterstitialUrl` functions. Use `clerkJSVersion` instead. Example:
11
+
12
+ ```diff
13
+ - loadInterstitialFromLocal({ pkgVersion: "..." })
14
+ + loadInterstitialFromLocal({ clerkJSVersion: "..." })
15
+ ```
@@ -0,0 +1,13 @@
1
+ ---
2
+ title: '`redirect` import moved to `@clerk/backend/internal`'
3
+ matcher: "import\\s+{[\\s\\S]*?redirect[\\s\\S]*?}\\s+from\\s+['\"]@clerk\\/(backend)['\"]"
4
+ matcherFlags: 'm'
5
+ replaceWithString: 'backend/internal'
6
+ ---
7
+
8
+ 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:
9
+
10
+ ```diff
11
+ - import { redirect } from "@clerk/backend"
12
+ + import { redirect } from "@clerk/backend/internal"
13
+ ```