Skip to content

Commit 8d73bea

Browse files
dimklLekoArts
andauthored
feat(express): Introduce Clerk package for Express (#2918)
* feat(express): Introduce @clerk/express [SDK-644] * chore(express): Apply PR comments * chore(express,clerk-sdk-node): Cleanup unused deps and files * Update packages/express/README.md Co-authored-by: Lennart <lekoarts@gmail.com> * Update packages/express/LICENSE Co-authored-by: Lennart <lekoarts@gmail.com> * Update .changeset/bright-gorillas-crash.md Co-authored-by: Lennart <lekoarts@gmail.com> * chore(express): Update dependencies to latest * chore(express): Replace `protect` with `requireAuth` and add some error handling * chore(*): Upgrade express playground to use `@clerk/express` * fix(express): Add tsconfig.lint.json to lint all files * chore(express): Update docs links * feat(express): Add tests * fix(repo): Add core-2 default keys to integrations keys sample json * chore(express): Address PR comments about docs & links * chore(express): Rename isAuthInRequest helper to requestHasAuthObject for readability * chore(express): Refactor clerkMiddleware to support clerkClient param instead of implicit creation --------- Co-authored-by: Lennart <lekoarts@gmail.com>
1 parent e5d63eb commit 8d73bea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1310
-55
lines changed

.changeset/bright-gorillas-crash.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@clerk/express': patch
3+
---
4+
5+
Introduce [Express](https://expressjs.com/) specific Clerk SDK called `@clerk/express`. The SDK exposes the following APIs:
6+
7+
- `clerkClient`: Default [`@clerk/backend`](https://clerk.com/docs/references/backend/overview) client initialized from environment variables and used to make backend API requests
8+
- `clerkMiddleware`: Centralized middleware that authenticates all requests without blocking them (also triggers handshake mechanism)
9+
- `getAuth`: Utility to retrieve the auth state from a request (requires `clerkMiddleware` to be executed)
10+
- `requireAuth`: Middleware that returns HTTP 401 response when request is signed-out
11+
12+
Also all the top level exports from `@clerk/backend` are re-exported from `@clerk/express`.

.github/labeler.yml

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ clerk-js:
1212
elements:
1313
- packages/elements/**
1414

15+
express:
16+
- packages/express/**
17+
1518
expo:
1619
- packages/expo/**
1720

.jit/config.yml

+3
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ folders:
3232
- ./**/*.test.ts
3333
- path: /packages/themes
3434
- path: /packages/types
35+
- path: /packages/express
36+
exclude:
37+
- ./**/*.test.ts

integration/.keys.json.sample

+4
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,9 @@
1010
"with-custom-roles": {
1111
"pk": "",
1212
"sk": ""
13+
},
14+
"core-2-all-enabled": {
15+
"pk": "",
16+
"sk": ""
1317
}
1418
}

0 commit comments

Comments
 (0)