') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Version Packages (alpha-v5) by clerk-cookie · Pull Request #2065 · clerk/javascript · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
51 changes: 50 additions & 1 deletion .changeset/pre.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,22 +22,47 @@
"blue-ghosts-float",
"blue-lies-drop",
"bright-trainers-sort",
"brown-clouds-divide",
"chatty-berries-jump",
"chatty-boats-tease",
"chilly-donuts-work",
"clever-scissors-reflect",
"clever-vans-flash",
"clever-wasps-invite",
"cuddly-cougars-check",
"cuddly-fireants-switch",
"curly-news-push",
"curvy-mails-rhyme",
"cyan-stingrays-own",
"dry-sheep-poke",
"dry-students-reflect",
"dull-stingrays-fix",
"empty-jars-press",
"fair-cameras-boil",
"famous-carrots-notice",
"famous-forks-buy",
"fast-ads-mix",
"fast-games-hide",
"few-kids-design",
"fifty-rats-rhyme",
"flat-ants-worry",
"flat-donuts-sleep",
"flat-pots-hear",
"friendly-tables-chew",
"friendly-vans-develop",
"funny-gifts-cough",
"gentle-pants-matter",
"gorgeous-baboons-float",
"gorgeous-insects-reply",
"honest-onions-work",
"hungry-bears-allow",
"khaki-spoons-teach",
"late-cooks-collect",
"late-dolphins-peel",
"lazy-planes-run",
"lemon-kings-love",
"little-numbers-jam",
"long-beds-mate",
"long-icons-share",
"loud-countries-hang",
"loud-lions-compete",
Expand All@@ -48,29 +73,53 @@
"mean-houses-juggle",
"metal-cougars-fail",
"metal-olives-press",
"mighty-pugs-knock",
"nasty-books-tap",
"new-eels-mix",
"odd-lemons-reply",
"old-actors-beg",
"orange-pumpkins-poke",
"poor-horses-press",
"poor-kings-marry",
"popular-singers-sort",
"pretty-mice-share",
"pretty-months-greet",
"pretty-singers-change",
"proud-hairs-check",
"purple-pumas-study",
"purple-rules-prove",
"quick-trains-rush",
"real-cougars-design",
"real-taxis-compare",
"red-coats-itch",
"red-monkeys-sing",
"rude-jobs-yawn",
"rude-lamps-yawn",
"selfish-eggs-sort",
"silly-icons-kick",
"silly-poems-tease",
"silver-cats-appear",
"six-kangaroos-serve",
"slimy-singers-glow",
"slow-wombats-battle",
"soft-birds-thank",
"sour-comics-stare",
"spotty-apples-march",
"spotty-roses-push",
"stupid-toys-remain",
"tasty-countries-walk",
"tasty-phones-lie",
"thin-phones-drop",
"thirty-doors-peel",
"thirty-insects-exist",
"tough-pots-grow",
"tough-roses-hunt",
"two-pumas-doubt",
"two-terms-speak",
"weak-elephants-grin",
"wild-phones-smoke",
"wise-houses-shop"
"wise-houses-shop",
"yellow-elephants-begin",
"young-frogs-enjoy"
]
}
116 changes: 116 additions & 0 deletions packages/backend/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,121 @@
# Change Log

## 1.0.0-alpha-v5.1

### Major Changes

- Drop default exports from all packages. Migration guide: ([#2150](https://github.com/clerk/javascript/pull/2150)) by [@dimkl](https://github.com/dimkl)

- use `import { Clerk } from '@clerk/backend';`
- use `import { clerkInstance } from '@clerk/clerk-sdk-node';`
- use `import { Clerk } from '@clerk/clerk-sdk-node';`
- use `import { Clerk } from '@clerk/clerk-js';`
- use `import { Clerk } from '@clerk/clerk-js/headless';`
- use `import { IsomorphicClerk } from '@clerk/clerk-react'`

- Change the response payload of Backend API requests to return `{ data, errors }` instead of return the data and throwing on error response. ([#2126](https://github.com/clerk/javascript/pull/2126)) by [@dimkl](https://github.com/dimkl)

Code example to keep the same behavior:

```typescript
import { users } from '@clerk/backend';
import { ClerkAPIResponseError } from '@clerk/shared/error';

const { data, errors, clerkTraceId, status, statusText } = await users.getUser('user_deadbeef');
if (errors) {
throw new ClerkAPIResponseError(statusText, { data: errors, status, clerkTraceId });
}
```

- Enforce passing `request` param to `authenticateRequest` method of `@clerk/backend` ([#2122](https://github.com/clerk/javascript/pull/2122)) by [@dimkl](https://github.com/dimkl)

instead of passing each header or cookie related option that is used internally to
determine the request state.

Migration guide:

- use `request` param in `clerkClient.authenticateRequest()` instead of:
- `origin`
- `host`
- `forwardedHost`
- `forwardedProto`
- `referrer`
- `userAgent`
- `cookieToken`
- `clientUat`
- `headerToken`
- `searchParams`

Example

```typescript
//
// current
//
import { clerkClient } from '@clerk/backend'

const requestState = await clerkClient.authenticateRequest({
secretKey: 'sk_....'
publishableKey: 'pk_....'
origin: req.headers.get('origin'),
host: req.headers.get('host'),
forwardedHost: req.headers.get('x-forwarded-host'),
forwardedProto: req.headers.get('x-forwarded-proto'),
referrer: req.headers.get('referer'),
userAgent: req.headers.get('user-agent'),
clientUat: req.cookies.get('__client_uat'),
cookieToken: req.cookies.get('__session'),
headerToken: req.headers.get('authorization'),
searchParams: req.searchParams
});

//
// new
//
import { clerkClient, } from '@clerk/backend'

// use req (if it's a fetch#Request instance) or use `createIsomorphicRequest` from `@clerk/backend`
// to re-construct fetch#Request instance
const requestState = await clerkClient.authenticateRequest({
secretKey: 'sk_....'
publishableKey: 'pk_....'
request: req
});

```

- Drop deprecated properties. Migration steps: ([#1899](https://github.com/clerk/javascript/pull/1899)) by [@dimkl](https://github.com/dimkl)

- use `createClerkClient` instead of `__unstable_options`
- use `publishableKey` instead of `frontendApi`
- use `clockSkewInMs` instead of `clockSkewInSeconds`
- use `apiKey` instead of `secretKey`
- drop `httpOptions`
- use `*.image` instead of
- `ExternalAccount.picture`
- `ExternalAccountJSON.avatar_url`
- `Organization.logoUrl`
- `OrganizationJSON.logo_url`
- `User.profileImageUrl`
- `UserJSON.profile_image_url`
- `OrganizationMembershipPublicUserData.profileImageUrl`
- `OrganizationMembershipPublicUserDataJSON.profile_image_url`
- drop `pkgVersion`
- use `Organization.getOrganizationInvitationList` with `status` instead of `getPendingOrganizationInvitationList`
- drop `orgs` claim (if required, can be manually added by using `user.organizations` in a jwt template)
- use `localInterstitial` instead of `remotePublicInterstitial` / `remotePublicInterstitialUrl`

Internal changes:

- replaced error enum (and it's) `SetClerkSecretKeyOrAPIKey` with `SetClerkSecretKey`

### Patch Changes

- Strip `experimental__has` from the auth object in `makeAuthObjectSerializable()`. This fixes an issue in Next.js where an error is being thrown when this function is passed to a client component as a prop. ([#2101](https://github.com/clerk/javascript/pull/2101)) by [@BRKalow](https://github.com/BRKalow)

- Updated dependencies [[`64d3763ec`](https://github.com/clerk/javascript/commit/64d3763ec73747ad04c4b47017195cf4114e150c), [`83e9d0846`](https://github.com/clerk/javascript/commit/83e9d08469e7c2840f06aa7d86831055e23f67a5), [`7f833da9e`](https://github.com/clerk/javascript/commit/7f833da9ebc1b2ec9c65513628c377d0584e5d72), [`492b8a7b1`](https://github.com/clerk/javascript/commit/492b8a7b12f14658a384566012e5807f0a171710), [`0d1052ac2`](https://github.com/clerk/javascript/commit/0d1052ac284b909786fd0e4744b02fcf4d1a8be6), [`5471c7e8d`](https://github.com/clerk/javascript/commit/5471c7e8dd0155348748fa90e5ae97093f59efe9), [`e0e79b4fe`](https://github.com/clerk/javascript/commit/e0e79b4fe47f64006718d547c898b9f67fe4d424)]:
- @clerk/shared@2.0.0-alpha-v5.1

## 1.0.0-alpha-v5.0

### Major Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/backend/package.json
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
{
"name": "@clerk/backend",
"version": "1.0.0-alpha-v5.0",
"version": "1.0.0-alpha-v5.1",
"description": "Clerk Backend SDK - REST Client for Backend API & JWT verification utilities",
"homepage": "https://clerk.com/",
"bugs": {
Expand DownExpand Up@@ -48,13 +48,13 @@
"test:cloudflare-workerd": "tests/cloudflare-workerd/run.sh"
},
"dependencies": {
"@clerk/shared": "2.0.0-alpha-v5.0",
"@clerk/shared": "2.0.0-alpha-v5.1",
"cookie": "0.5.0",
"snakecase-keys": "5.4.4",
"tslib": "2.4.1"
},
"devDependencies": {
"@clerk/types": "4.0.0-alpha-v5.0",
"@clerk/types": "4.0.0-alpha-v5.1",
"@cloudflare/workers-types": "^3.18.0",
"@types/chai": "^4.3.3",
"@types/cookie": "^0.5.1",
Expand Down
59 changes: 59 additions & 0 deletions packages/chrome-extension/CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,64 @@
# Change Log

## 1.0.0-alpha-v5.1

### Major Changes

- Drop default exports from all packages. Migration guide: ([#2150](https://github.com/clerk/javascript/pull/2150)) by [@dimkl](https://github.com/dimkl)

- use `import { Clerk } from '@clerk/backend';`
- use `import { clerkInstance } from '@clerk/clerk-sdk-node';`
- use `import { Clerk } from '@clerk/clerk-sdk-node';`
- use `import { Clerk } from '@clerk/clerk-js';`
- use `import { Clerk } from '@clerk/clerk-js/headless';`
- use `import { IsomorphicClerk } from '@clerk/clerk-react'`

- Drop deprecations. Migration steps: ([#2082](https://github.com/clerk/javascript/pull/2082)) by [@dimkl](https://github.com/dimkl)

- 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()`

- Drop deprecations. Migration steps: ([#1993](https://github.com/clerk/javascript/pull/1993)) by [@dimkl](https://github.com/dimkl)

- use `setActive` instead of `setSession` from `useSessionList | useSignUp | useSignIn` hooks
- use `publishableKey` instead of `frontendApi`
- use `handleEmailLinkVerification` instead of `handleMagicLinkVerification` from `IsomorphicClerk`
- use `isEmailLinkError` instead of `isMagicLinkError`
- use `EmailLinkErrorCode` instead of `MagicLinkErrorCode`
- use `useEmailLink` instead of `useMagicLink`

### Patch Changes

- Updated dependencies [[`1ddffb67e`](https://github.com/clerk/javascript/commit/1ddffb67e90c3a784d1616814d86f43d2c8b7de0), [`64d3763ec`](https://github.com/clerk/javascript/commit/64d3763ec73747ad04c4b47017195cf4114e150c), [`deac67c1c`](https://github.com/clerk/javascript/commit/deac67c1c40d6d3ccc3559746c0c31cc29a93b84), [`034abeb76`](https://github.com/clerk/javascript/commit/034abeb762744c4948ef6600b21cd9dd68d165a8), [`83e9d0846`](https://github.com/clerk/javascript/commit/83e9d08469e7c2840f06aa7d86831055e23f67a5), [`08dd88c4a`](https://github.com/clerk/javascript/commit/08dd88c4a829afd8c4fee48b9a31a39162381761), [`5f49568f6`](https://github.com/clerk/javascript/commit/5f49568f6e345ce63b15a4c301fc81c3af30211a), [`e400fa9e3`](https://github.com/clerk/javascript/commit/e400fa9e33b44e28a18bee416267a75cdc3ae3cb), [`7f833da9e`](https://github.com/clerk/javascript/commit/7f833da9ebc1b2ec9c65513628c377d0584e5d72), [`9e10d577e`](https://github.com/clerk/javascript/commit/9e10d577e2a4b9b2cbf8b3272d6e58f4627ae922), [`27052469e`](https://github.com/clerk/javascript/commit/27052469e89558c57bfd19466a11b47bdb3a4d38), [`492b8a7b1`](https://github.com/clerk/javascript/commit/492b8a7b12f14658a384566012e5807f0a171710), [`d005992e0`](https://github.com/clerk/javascript/commit/d005992e0514970730d2f516a99bf20fcfac47f7), [`2a22aade8`](https://github.com/clerk/javascript/commit/2a22aade8c9bd1f83a9be085983f96fa87903804), [`f77e8cdbd`](https://github.com/clerk/javascript/commit/f77e8cdbd24411f7f9dbfdafcab0596c598f66c1), [`b0ca7b801`](https://github.com/clerk/javascript/commit/b0ca7b801f77210e78a33e7023fb671120f1cfc3), [`d1b524ffb`](https://github.com/clerk/javascript/commit/d1b524ffba0be0cd683e6ace85b91b382ad442bb), [`db3eefe8c`](https://github.com/clerk/javascript/commit/db3eefe8c0fc04ce1de47610dc23769a18f1629c), [`0d1052ac2`](https://github.com/clerk/javascript/commit/0d1052ac284b909786fd0e4744b02fcf4d1a8be6), [`5471c7e8d`](https://github.com/clerk/javascript/commit/5471c7e8dd0155348748fa90e5ae97093f59efe9), [`477170962`](https://github.com/clerk/javascript/commit/477170962f486fd4e6b0653a64826573f0d8621b), [`59336d3d4`](https://github.com/clerk/javascript/commit/59336d3d468edd205c0e5501b7d5046611ee217d), [`e0e79b4fe`](https://github.com/clerk/javascript/commit/e0e79b4fe47f64006718d547c898b9f67fe4d424), [`3c4209068`](https://github.com/clerk/javascript/commit/3c42090688166b74badfdefc7ed8c428601a0ba7)]:
- @clerk/clerk-js@5.0.0-alpha-v5.1
- @clerk/clerk-react@5.0.0-alpha-v5.1

## 1.0.0-alpha-v5.0

### Major Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/chrome-extension/package.json
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
{
"name": "@clerk/chrome-extension",
"version": "1.0.0-alpha-v5.0",
"version": "1.0.0-alpha-v5.1",
"description": "Clerk SDK for Chrome extensions",
"keywords": [
"auth",
Expand DownExpand Up@@ -45,8 +45,8 @@
"test:coverage": "jest --collectCoverage && open coverage/lcov-report/index.html"
},
"dependencies": {
"@clerk/clerk-js": "5.0.0-alpha-v5.0",
"@clerk/clerk-react": "5.0.0-alpha-v5.0"
"@clerk/clerk-js": "5.0.0-alpha-v5.1",
"@clerk/clerk-react": "5.0.0-alpha-v5.1"
},
"devDependencies": {
"@types/chrome": "*",
Expand Down
Loading