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
39 changes: 38 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"@clerk/clerk-sdk-node": "4.12.16",
"@clerk/shared": "1.0.0",
"@clerk/themes": "1.7.9",
"@clerk/types": "3.57.0"
"@clerk/types": "3.57.0",
"@clerk/elements": "0.0.1"
},
"changesets": [
"afraid-nails-play",
Expand All @@ -26,6 +27,7 @@
"blue-grapes-marry",
"blue-lies-drop",
"brave-suits-drive",
"bright-dragons-join",
"bright-knives-jump",
"bright-plants-swim",
"bright-trainers-sort",
Expand Down Expand Up @@ -57,23 +59,28 @@
"dry-feet-join",
"dry-sheep-poke",
"dry-students-reflect",
"dull-ants-argue",
"dull-stingrays-fix",
"dull-wasps-begin",
"early-forks-argue",
"early-timers-wave",
"early-tomatoes-hide",
"eight-badgers-speak",
"eighty-walls-appear",
"eleven-bananas-joke",
"empty-jars-press",
"fair-bears-build",
"fair-cameras-boil",
"famous-carrots-notice",
"famous-forks-buy",
"famous-penguins-bow",
"famous-spies-clean",
"fast-ads-mix",
"fast-games-hide",
"fast-swans-smile",
"few-kids-design",
"fifty-rats-rhyme",
"fifty-snakes-accept",
"flat-ants-worry",
"flat-clocks-clap",
"flat-donuts-sleep",
Expand All @@ -87,6 +94,7 @@
"funny-lamps-work",
"fuzzy-horses-fix",
"fuzzy-years-taste",
"gentle-berries-teach",
"gentle-donkeys-talk",
"gentle-pants-matter",
"gold-fireants-sort",
Expand All @@ -98,21 +106,28 @@
"heavy-falcons-help",
"heavy-horses-nail",
"hip-eagles-clap",
"hip-planets-reply",
"honest-onions-work",
"honest-pigs-smoke",
"hungry-bears-allow",
"hungry-bikes-clean",
"hungry-news-bathe",
"itchy-chairs-argue",
"itchy-chairs-call",
"itchy-papayas-dress",
"khaki-buttons-march",
"khaki-spoons-teach",
"khaki-timers-work",
"kind-onions-think",
"late-cooks-collect",
"late-dolphins-peel",
"late-flies-switch",
"late-pillows-notice",
"lazy-planes-run",
"lemon-crews-do",
"lemon-kings-love",
"lemon-rockets-explode",
"light-spoons-divide",
"little-apes-notice",
"little-dolphins-scream",
"little-numbers-jam",
Expand All @@ -122,6 +137,7 @@
"loud-countries-hang",
"loud-lions-compete",
"loud-panthers-poke",
"lovely-experts-deny",
"lovely-jobs-arrive",
"lovely-mirrors-remember",
"lovely-plums-sin",
Expand All @@ -131,14 +147,19 @@
"many-flowers-heal",
"many-weeks-march",
"mean-houses-juggle",
"mean-numbers-grin",
"mean-poets-bow",
"metal-baboons-vanish",
"metal-cougars-fail",
"metal-ears-cheat",
"metal-olives-press",
"metal-wolves-wave",
"mighty-bulldogs-try",
"mighty-melons-greet",
"mighty-pugs-knock",
"mighty-rice-marry",
"modern-buses-sort",
"modern-mayflies-sort",
"moody-radios-begin",
"moody-trainers-bow",
"moody-zoos-deliver",
Expand All @@ -153,13 +174,17 @@
"nice-doors-fail",
"nice-starfishes-itch",
"nine-beans-travel",
"nine-cooks-retire",
"odd-eels-ring",
"odd-lemons-reply",
"odd-toes-develop",
"old-actors-beg",
"old-ads-push",
"old-onions-swim",
"old-timers-obey",
"olive-steaks-end",
"orange-pumpkins-poke",
"perfect-ants-joke",
"pink-days-drum",
"polite-kiwis-arrive",
"poor-horses-press",
Expand All @@ -171,18 +196,21 @@
"pretty-scissors-thank",
"pretty-singers-change",
"proud-hairs-check",
"proud-trees-yell",
"purple-pumas-study",
"purple-rules-prove",
"quick-countries-scream",
"quick-trains-rush",
"quiet-cougars-watch",
"rare-bottles-sell",
"rare-poets-deliver",
"rare-students-sell",
"real-cougars-design",
"real-taxis-compare",
"red-coats-itch",
"red-monkeys-sing",
"red-shrimps-hunt",
"red-suns-perform",
"red-worms-fetch",
"rich-actors-cross",
"rich-readers-obey",
Expand All @@ -204,17 +232,22 @@
"silly-icons-kick",
"silly-poems-tease",
"silver-cats-appear",
"silver-weeks-roll",
"six-kangaroos-serve",
"sixty-frogs-pump",
"sixty-months-listen",
"slimy-brooms-smoke",
"slimy-singers-glow",
"slimy-ties-approve",
"slimy-windows-grab",
"slimy-wolves-burn",
"slow-bugs-exist",
"slow-eels-fly",
"slow-wombats-battle",
"small-cats-check",
"small-ladybugs-mate",
"smart-suns-train",
"smart-ways-sing",
"smooth-baboons-shake",
"smooth-pets-rhyme",
"soft-birds-thank",
Expand All @@ -235,12 +268,14 @@
"tame-olives-check",
"tasty-countries-walk",
"tasty-phones-lie",
"tasty-terms-fly",
"ten-mugs-film",
"ten-nails-whisper",
"thin-phones-drop",
"thirty-chicken-divide",
"thirty-doors-peel",
"thirty-insects-exist",
"tidy-buttons-pump",
"tiny-forks-sit",
"tough-pots-grow",
"tough-roses-hunt",
Expand All @@ -250,11 +285,13 @@
"two-pumas-doubt",
"two-terms-speak",
"violet-birds-scream",
"weak-bears-cover",
"weak-elephants-grin",
"wicked-spoons-confess",
"wild-phones-smoke",
"wise-houses-shop",
"wise-lions-type",
"wise-scissors-know",
"witty-forks-cheer",
"yellow-elephants-begin",
"yellow-tigers-know",
Expand Down
148 changes: 148 additions & 0 deletions packages/backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,153 @@
# Change Log

## 1.0.0-alpha-v5.10

### Major Changes

- Change return value of `verifyToken()` from `@clerk/backend` to `{ data, error}`. ([#2377](https://github.com/clerk/javascript/pull/2377)) by [@dimkl](https://github.com/dimkl)

To replicate the current behaviour use this:

```typescript
import { verifyToken } from '@clerk/backend'

const { data, error } = await verifyToken(...);
if(error){
throw error;
}
```

- Change return values of `signJwt`, `hasValidSignature`, `decodeJwt`, `verifyJwt` ([#2377](https://github.com/clerk/javascript/pull/2377)) by [@dimkl](https://github.com/dimkl)

to return `{ data, error }`. Example of keeping the same behavior using those utilities:

```typescript
import { signJwt, hasValidSignature, decodeJwt, verifyJwt } from '@clerk/backend/jwt';

const { data, error } = await signJwt(...)
if (error) throw error;

const { data, error } = await hasValidSignature(...)
if (error) throw error;

const { data, error } = decodeJwt(...)
if (error) throw error;

const { data, error } = await verifyJwt(...)
if (error) throw error;
```

- Changes in exports of `@clerk/backend`: ([#2363](https://github.com/clerk/javascript/pull/2363)) by [@dimkl](https://github.com/dimkl)

- Expose the following helpers and enums from `@clerk/backend/internal`:
```typescript
import {
AuthStatus,
buildRequestUrl,
constants,
createAuthenticateRequest,
createIsomorphicRequest,
debugRequestState,
makeAuthObjectSerializable,
prunePrivateMetadata,
redirect,
sanitizeAuthObject,
signedInAuthObject,
signedOutAuthObject,
} from '@clerk/backend/internal';
```
- Drop the above exports from the top-level api:
```typescript
// Before
import { AuthStatus, ... } from '@clerk/backend';
// After
import { AuthStatus, ... } from '@clerk/backend/internal';
```
Dropping those exports results in also dropping the exports from `gatsby-plugin-clerk`, `@clerk/clerk-sdk-node`, `@clerk/backend`, `@clerk/fastify`, `@clerk/nextjs`, `@clerk/remix` packages.

- Changes in exports of `@clerk/backend`: ([#2365](https://github.com/clerk/javascript/pull/2365)) by [@dimkl](https://github.com/dimkl)

- Drop the following internal exports from the top-level api:
```typescript
// Before
import {
AllowlistIdentifier,
Client,
DeletedObject,
Email,
EmailAddress,
ExternalAccount,
IdentificationLink,
Invitation,
OauthAccessToken,
ObjectType,
Organization,
OrganizationInvitation,
OrganizationMembership,
OrganizationMembershipPublicUserData,
PhoneNumber,
RedirectUrl,
SMSMessage,
Session,
SignInToken,
Token,
User,
Verification,
} from '@clerk/backend';
// After : no alternative since there is no need to use those classes
```
Dropping those exports results in also dropping the exports from `gatsby-plugin-clerk`, `@clerk/clerk-sdk-node`, `@clerk/backend`, `@clerk/fastify`, `@clerk/nextjs`, `@clerk/remix` packages.
- Keep those 3 resource related type exports
```typescript
import type { Organization, Session, User, WebhookEvent, WebhookEventType } from '@clerk/backend';
```

- Changes in exports of `@clerk/backend`: ([#2364](https://github.com/clerk/javascript/pull/2364)) by [@dimkl](https://github.com/dimkl)

- Expose the following helpers and enums from `@clerk/backend/jwt`:
```typescript
import { decodeJwt, hasValidSignature, signJwt, verifyJwt } from '@clerk/backend/jwt';
```
- Drop the above exports from the top-level api:
```typescript
// Before
import { decodeJwt, ... } from '@clerk/backend';
// After
import { decodeJwt, ... } from '@clerk/backend/jwt';
```
Dropping those exports results in also dropping the exports from `gatsby-plugin-clerk`, `@clerk/clerk-sdk-node`, `@clerk/backend`, `@clerk/fastify`, `@clerk/nextjs`, `@clerk/remix` packages.

- Changes in `@clerk/backend` exports: ([#2362](https://github.com/clerk/javascript/pull/2362)) by [@dimkl](https://github.com/dimkl)

- Drop Internal `deserialize` helper
- Introduce `/errors` subpath export, eg:
```typescript
import {
TokenVerificationError,
TokenVerificationErrorAction,
TokenVerificationErrorCode,
TokenVerificationErrorReason,
} from '@clerk/backend/errors';
```
- Drop errors from top-level export
```typescript
// Before
import { TokenVerificationError, TokenVerificationErrorReason } from '@clerk/backend';
// After
import { TokenVerificationError, TokenVerificationErrorReason } from '@clerk/backend/errors';
```

### Minor Changes

- Improve ESM support in `@clerk/backend` for Node by using .mjs for #crypto subpath import ([#2360](https://github.com/clerk/javascript/pull/2360)) by [@dimkl](https://github.com/dimkl)

### Patch Changes

- Update the handshake flow to only trigger for document requests. ([#2352](https://github.com/clerk/javascript/pull/2352)) by [@BRKalow](https://github.com/BRKalow)

- Updated dependencies [[`5f58a2274`](https://github.com/clerk/javascript/commit/5f58a22746aba94f76bef5dbbc94fa93ea3b0b7e)]:
- @clerk/shared@2.0.0-alpha-v5.7

## 1.0.0-alpha-v5.9

### Major Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clerk/backend",
"version": "1.0.0-alpha-v5.9",
"version": "1.0.0-alpha-v5.10",
"description": "Clerk Backend SDK - REST Client for Backend API & JWT verification utilities",
"homepage": "https://clerk.com/",
"bugs": {
Expand Down Expand Up @@ -95,13 +95,13 @@
"test:cloudflare-workerd": "tests/cloudflare-workerd/run.sh"
},
"dependencies": {
"@clerk/shared": "2.0.0-alpha-v5.6",
"@clerk/shared": "2.0.0-alpha-v5.7",
"cookie": "0.5.0",
"snakecase-keys": "5.4.4",
"tslib": "2.4.1"
},
"devDependencies": {
"@clerk/types": "4.0.0-alpha-v5.10",
"@clerk/types": "4.0.0-alpha-v5.11",
"@cloudflare/workers-types": "^3.18.0",
"@types/chai": "^4.3.3",
"@types/cookie": "^0.5.1",
Expand Down
Loading