A portable authentication module with pluggable providers and framework adapters.
- kenmon - Core authentication service
- @kenmon/nextjs-adapter - Next.js framework adapter
- @kenmon/react-router-adapter - React Router framework adapter
- @kenmon/email-otp-authenticator - Email OTP authenticator
- @kenmon/google-oauth-authenticator - Google OAuth authenticator
Check these example to learn how to use the packages.
- nextjs-example - Full Next.js implementation example
- react-router-example - Full React Router implementation example
See individual package READMEs for usage details and the nextjs-example for a complete implementation.
# Install dependencies
pnpm install
# Build all packages
pnpm run build
# Clean build artifacts
pnpm run cleanThis monorepo uses Changesets for version management and publishing. We use independent versioning with pre-release mode enabled.
-
Make your code changes across one or more packages
-
Create a changeset to document the changes:
pnpm changeset
- Select which packages changed (use spacebar to select, enter to confirm)
- Choose the bump type:
patch- Bug fixes (1.0.0-pre.0 → 1.0.0-pre.1)minor- New features (1.0.0-pre.0 → 1.0.1-pre.0)major- Breaking changes (1.0.0-pre.0 → 1.1.0-pre.0)
- Write a summary of the changes (used in CHANGELOG.md)
-
Version the packages to bump versions and generate changelogs:
pnpm version-packages
This will:
- Update package.json versions with pre-release numbers (e.g.,
1.0.0-pre.1) - Generate/update CHANGELOG.md files
- Delete consumed changeset files
- Update package.json versions with pre-release numbers (e.g.,
-
Review and commit the version changes:
git add . git commit -m "Version packages"
-
Publish to npm:
pnpm release
This will:
- Build all packages
- Publish changed packages to npm with the
pretag - Create git tags for each version
-
Push changes and tags:
git push && git push --tags
When ready to publish a stable 1.0.0 release:
-
Exit pre-release mode:
pnpm changeset pre exit -
Create a final changeset for the stable release:
pnpm changeset
-
Version and publish as normal:
pnpm version-packages git add . && git commit -m "Release v1.0.0" pnpm release git push && git push --tags
Users can install pre-release versions with:
# Install specific pre-release version
pnpm add kenmon@1.0.0-pre.1
# Install latest pre-release
pnpm add kenmon@preMIT