Skip to main content

Installation

logto-authkit is available as a single npm package that includes both frontend and server features.

Install the package

Peer dependencies

logto-authkit requires the following peer dependencies for frontend features:
  • @logto/react - ^3.0.0 || ^4.0.0
  • react - ^17.0.0 || ^19.0.0
  • react-dom - ^17.0.0 || ^19.0.0
These should be installed automatically by your package manager, but if not, install them manually:
Server features work independently and don’t require React dependencies.

Package exports

logto-authkit provides three main exports:

Main entry (frontend)

Includes all frontend components and hooks for React applications.

Server entry

Includes JWT verification, Express middleware, and Next.js helpers.

Bundler config entry

Pre-configured bundler settings for Vite, Webpack, and Next.js.
When editing build-time scripts, import from @ouim/logto-authkit/bundler-config to avoid executing the main library bundle.

TypeScript support

logto-authkit is written in TypeScript and provides comprehensive type definitions out of the box.

Next steps

Quick start

Get up and running with authentication in minutes