javascript icon indicating copy to clipboard operation
javascript copied to clipboard

feat(express): Introduce Clerk package for Express

Open dimkl opened this issue 1 year ago • 1 comments

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
  • [x] 🌟 New feature
  • [ ] 🔨 Breaking change
  • [ ] 📖 Refactoring / dependency upgrade / documentation
  • [ ] other:

TODOs

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

dimkl avatar Mar 02 '24 01:03 dimkl

🦋 Changeset detected

Latest commit: 55d9b64d3dda2563ba4de99e07c1a7707389492f

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

changeset-bot[bot] avatar Mar 02 '24 01:03 changeset-bot[bot]

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

dimkl avatar Apr 02 '24 13:04 dimkl