Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(express): Introduce Clerk package for Express #2918

Merged
merged 16 commits into from
Apr 5, 2024
Merged

feat(express): Introduce Clerk package for Express #2918

merged 16 commits into from
Apr 5, 2024

Conversation

dimkl
Copy link
Contributor

@dimkl dimkl commented Mar 2, 2024

Description

Introduce Express specific Clerk SDK @clerk/express. The SDK exposes the following API:

  • clerkClient: default @clerk/backend client initialized from env variables and used to make BAPI requests
  • clerkMiddleware: centralized middleware that authenticates all requests without blocking them (also triggers handshake mechanism)
  • getAuth: utility to retrieve the auth state from the request (requires clerkMiddleware to executed)
  • requireAuth: middleware that returns http 401 response when request is signed-out

Also all the top level exports from @clerk/backend are re-exported from @clerk/express top level.

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

TODOs

  • Add tests
  • Add examples
  • Replace all TODO(express) TODOs
  • Use this package to create separate page in backend-request/handling docs

@dimkl dimkl requested a review from nikosdouvlis March 2, 2024 01:20
@dimkl dimkl self-assigned this Mar 2, 2024
Copy link

changeset-bot bot commented Mar 2, 2024

🦋 Changeset detected

Latest commit: 55d9b64

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/express Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass at looking through the changes :)

Base automatically changed from backend/debug to main March 11, 2024 11:34
@dimkl dimkl force-pushed the feat/express branch 2 times, most recently from e213120 to 3ed2a03 Compare March 11, 2024 18:47
@dimkl dimkl requested a review from LekoArts March 11, 2024 18:48
@dimkl dimkl force-pushed the feat/express branch 3 times, most recently from d771634 to 94530c5 Compare March 15, 2024 13:46
@dimkl dimkl force-pushed the feat/express branch 3 times, most recently from 61e0396 to 2029c38 Compare March 15, 2024 14:00
@dimkl dimkl force-pushed the feat/express branch 2 times, most recently from 3d62ee1 to 5ac94e9 Compare March 29, 2024 11:55
@dimkl
Copy link
Contributor Author

dimkl commented Apr 2, 2024

@LekoArts, @nikosdouvlis Could you take another look at this PR?

@dimkl dimkl force-pushed the feat/express branch 3 times, most recently from e13a230 to 4a035c5 Compare April 2, 2024 20:48
Copy link
Member

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, some minor comments I'd like to resolve before merging

@dimkl dimkl force-pushed the feat/express branch 2 times, most recently from 30cceb7 to 91e596a Compare April 4, 2024 10:34
@dimkl dimkl enabled auto-merge (squash) April 5, 2024 10:25
@dimkl dimkl merged commit 8d73bea into main Apr 5, 2024
10 checks passed
@dimkl dimkl deleted the feat/express branch April 5, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants