Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
19bb275
chore(clerk-react): Drop `frontendApi`
dimkl Oct 31, 2023
bafa9a4
chore(clerk-react,chrome-extension): Drop `*MagicLink*` related exports
dimkl Oct 31, 2023
7bc4b66
chore(clerk-js): Drop `*MagicLink*` related exports
dimkl Nov 7, 2023
fa10b24
chore(types): Drop `*MagicLink*` related exports
dimkl Nov 7, 2023
22d4acb
chore(clerk-js): Drop `orgs` claim
dimkl Nov 7, 2023
5fac548
chore(clerk-js,types): Drop `afterSwitchOrganizationUrl` claim
dimkl Nov 7, 2023
60f6857
chore(clerk-js): Drop support for `frontendApi` as parameter
dimkl Nov 7, 2023
6d19126
chore(clerk-js,types): Drop image related properties
dimkl Nov 7, 2023
77103d9
chore(clerk-js,types): Drop `*captcha` related methods from Clerk
dimkl Nov 7, 2023
af93de6
chore(clerk-js,types): Drop `Organization` related deprecations
dimkl Nov 7, 2023
d7ccdab
chore(*): Drop `useOrganizations`
dimkl Nov 8, 2023
b00a5b8
chore(clerk-js,types): Drop `appearance.userProfile`
dimkl Nov 8, 2023
730e044
chore(clerk-js,clerk-react): Drop `membershipList` and `invitationLis…
dimkl Nov 8, 2023
e8a74d4
chore(clerk-js,types): Drop `Clerk.setSession`
dimkl Nov 8, 2023
c92c48c
chore(clerk-js,types): Drop `redirect_url` deprecations
dimkl Nov 8, 2023
2dc560a
chore(clerk-js,types): Drop `GetMembershipsParams`
dimkl Nov 8, 2023
750ba6c
chore(clerk-js): Drop `generateSignature`
dimkl Nov 8, 2023
1039bd2
chore(clerk-js,types): Drop `password`
dimkl Nov 8, 2023
418ba18
chore(clerk-js,types): Drop deprecated `addListener/removeListener` f…
dimkl Nov 8, 2023
0444da0
chore(repo): Add word spelling in vscode workspace + fix typos
dimkl Nov 9, 2023
1093fd6
chore(clerk-js,types): Use paginated responses in get memberships end…
dimkl Nov 9, 2023
07a9238
chore(repo): Add changeset
dimkl Nov 8, 2023
c195500
chore(clerk-js,types): Address PR comments
dimkl Nov 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .changeset/fast-games-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
'@clerk/chrome-extension': major
'@clerk/clerk-js': major
'@clerk/nextjs': major
'@clerk/shared': major
'@clerk/clerk-react': major
'@clerk/types': major
'@clerk/clerk-expo': major
---

Drop deprecations. Migration steps:
- use `publishableKey` instead of `frontendApi`
- use `Clerk.handleEmailLinkVerification()` instead of `Clerk.handleMagicLinkVerification()`
- use `isEmailLinkError` instead of `isMagicLinkError`
- use `EmailLinkErrorCode` instead of `MagicLinkErrorCode`
- use `useEmailLink` instead of `useMagicLink`
- drop `orgs` jwt claim from session token
- use `ExternalAccount.imageUrl` instead of `ExternalAccount.avatarUrl`
- use `Organization.imageUrl` instead of `Organization.logoUrl`
- use `User.imageUrl` instead of `User.profileImageUrl`
- use `OrganizationMembershipPublicUserData.imageUrl` instead of `OrganizationMembershipPublicUserData.profileImageUrl`
- use `useOrganizationList` instead of `useOrganizations`
- use `userProfileProps` instead of `userProfile` in `Appearance`
- use `Clerk.setActive()` instead of `Clerk.setSession()`
- drop `password` param in `User.update()`
- use `afterSelectOrganizationUrl` instead of `afterSwitchOrganizationUrl` in `OrganizationSwitcher`
- drop `Clerk.experimental_canUseCaptcha` / `Clerk.Clerk.experimental_captchaSiteKey` / `Clerk.experimental_captchaURL` (were meant for internal use)
- use `User.getOrganizationMemberships()` instead of `Clerk.getOrganizationMemberships()`
- drop `lastOrganizationInvitation` / `lastOrganizationMember` from Clerk emitted events
- drop `Clerk.__unstable__invitationUpdate` / `Clerk.__unstable__membershipUpdate`
- drop support for string param in `Organization.create()`
- use `Organization.getInvitations()` instead of `Organization.getPendingInvitations()`
- use `pageSize` instead of `limit` in `OrganizationMembership.retrieve()`
- use `initialPage` instead of `offset` in `OrganizationMembership.retrieve()`
- drop `lastOrganizationInvitation` / `lastOrganizationMember` from ClerkProvider
- use `invitations` instead of `invitationList` in `useOrganization`
- use `memberships` instead of `membershipList` in `useOrganization`
- use `redirectUrl` instead of `redirect_url` in `User.createExternalAccount()`
- use `signature` instead of `generatedSignature` in `Signup.attemptWeb3WalletVerification()`
21 changes: 20 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,24 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
},
"eslint.workingDirectories": [{ "mode": "auto" }],
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"cSpell.words": [
"accountsstage",
"adduser",
"arethetypeswrong",
"attw",
"BAPI",
"citty",
"execa",
"FAPI",
"jwks",
"lclclerk",
"lclstage",
"nextjs",
"publint"
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ exports[`public exports should not include a breaking change 1`] = `
"useEmailLink",
"useOrganization",
"useOrganizationList",
"useOrganizations",
"useSession",
"useSessionList",
"useSignIn",
Expand Down
11 changes: 5 additions & 6 deletions packages/clerk-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ There are two ways you can include ClerkJS in your project. You can either [impo
npm install @clerk/clerk-js
```

Once you have installed the package, you will need to import the ClerkJS object constructor into your code and pass it your [Frontend API](https://dashboard.clerk.com/last-active?path=api-keys) as a parameter.
Once you have installed the package, you will need to import the ClerkJS object constructor into your code and pass it your [Publishable Key](https://dashboard.clerk.com/last-active?path=api-keys) as a parameter.

```js
import Clerk from '@clerk/clerk-js';

const clerkFrontendApi = 'pk_[publishable_key]';
const clerk = new Clerk(clerkFrontendApi);
const clerkPublishableKey = 'pk_[publishable_key]';
Comment thread
LekoArts marked this conversation as resolved.
const clerk = new Clerk(clerkPublishableKey);
await clerk.load({
// Set load options here...
});
Expand All @@ -65,14 +65,13 @@ Add the following script to your site's `<body>` element:
```html
<script>
// Get this URL and Publishable Key from the Clerk Dashboard
const clerkFrontendApi = 'pk_[publishable_key]';
const clerkPublishableKey = 'pk_[publishable_key]';
const frontendApi = '[your-domain].clerk.accounts.dev';
const version = '@latest'; // Set to appropriate version

// Creates asynchronous script
const script = document.createElement('script');
script.setAttribute('data-clerk-frontend-api', frontendApi);
script.setAttribute('data-clerk-publishable-key', clerkFrontendApi);
script.setAttribute('data-clerk-publishable-key', clerkPublishableKey);
script.async = true;
script.src = `https://${frontendApi}/npm/@clerk/clerk-js${version}/dist/clerk.browser.js`;

Expand Down
3 changes: 0 additions & 3 deletions packages/clerk-js/jest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ if (typeof window !== 'undefined') {
matches: false,
media: query,
onchange: null,
addListener: jest.fn(), // deprecated
removeListener: jest.fn(), // deprecated
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn(),
Expand All @@ -28,7 +26,6 @@ if (typeof window !== 'undefined') {

//@ts-expect-error
global.IntersectionObserver = class IntersectionObserver {
// eslint-disable-next-line @typescript-eslint/no-empty-function
constructor() {}

disconnect() {
Expand Down
20 changes: 10 additions & 10 deletions packages/clerk-js/src/core/clerk.redirects.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const mockUserSettings = {
},
};

const developmentFrontendApi = 'clerk.abcef.12345.dev.lclclerk.com';
const productionFrontendApi = 'clerk.abcef.12345.prod.lclclerk.com';
const developmentPublishableKey = 'pk_test_Y2xlcmsuYWJjZWYuMTIzNDUuZGV2LmxjbGNsZXJrLmNvbSQ';
const productionPublishableKey = 'pk_live_Y2xlcmsuYWJjZWYuMTIzNDUucHJvZC5sY2xjbGVyay5jb20k';
Comment thread
panteliselef marked this conversation as resolved.

describe('Clerk singleton - Redirects', () => {
let mockNavigate = jest.fn();
Expand Down Expand Up @@ -111,12 +111,12 @@ describe('Clerk singleton - Redirects', () => {

mockUsesUrlBasedSessionSync.mockReturnValue(true);

clerkForProductionInstance = new Clerk(productionFrontendApi);
clerkForProductionInstance = new Clerk(productionPublishableKey);
await clerkForProductionInstance.load({
navigate: mockNavigate,
});

clerkForDevelopmentInstance = new Clerk(developmentFrontendApi);
clerkForDevelopmentInstance = new Clerk(developmentPublishableKey);
await clerkForDevelopmentInstance.load({
navigate: mockNavigate,
});
Expand Down Expand Up @@ -189,12 +189,12 @@ describe('Clerk singleton - Redirects', () => {

mockUsesUrlBasedSessionSync.mockReturnValue(true);

clerkForProductionInstance = new Clerk(productionFrontendApi);
clerkForProductionInstance = new Clerk(productionPublishableKey);
await clerkForProductionInstance.load({
navigate: mockNavigate,
});

clerkForDevelopmentInstance = new Clerk(developmentFrontendApi);
clerkForDevelopmentInstance = new Clerk(developmentPublishableKey);
await clerkForDevelopmentInstance.load({
navigate: mockNavigate,
});
Expand Down Expand Up @@ -280,12 +280,12 @@ describe('Clerk singleton - Redirects', () => {
beforeEach(async () => {
mockUsesUrlBasedSessionSync.mockReturnValue(false);

clerkForProductionInstance = new Clerk(productionFrontendApi);
clerkForProductionInstance = new Clerk(productionPublishableKey);
await clerkForProductionInstance.load({
navigate: mockNavigate,
});

clerkForDevelopmentInstance = new Clerk(developmentFrontendApi);
clerkForDevelopmentInstance = new Clerk(developmentPublishableKey);
await clerkForDevelopmentInstance.load({
navigate: mockNavigate,
});
Expand Down Expand Up @@ -313,12 +313,12 @@ describe('Clerk singleton - Redirects', () => {
}),
);

clerkForProductionInstance = new Clerk(productionFrontendApi);
clerkForProductionInstance = new Clerk(productionPublishableKey);
await clerkForProductionInstance.load({
navigate: mockNavigate,
});

clerkForDevelopmentInstance = new Clerk(developmentFrontendApi);
clerkForDevelopmentInstance = new Clerk(developmentPublishableKey);
await clerkForDevelopmentInstance.load({
navigate: mockNavigate,
});
Expand Down
Loading