lucia-auth / lucia

Authentication, simple and clean
https://lucia-auth.com
MIT License
8.32k stars 447 forks source link
auth oauth typescript

Lucia

Lucia is an auth library written in TypeScript that abstracts away the complexity of handling sessions. It works alongside your database to provide an API that's easy to use, understand, and extend.

import { Lucia } from "lucia";

const lucia = new Lucia(new Adapter(db));

const session = await lucia.createSession(userId, {});
await lucia.validateSession(session.id);

Lucia is an open source library released under the MIT license, with the help of 100+ contributors!

Resources

Documentation

Join the Discord server!

Examples

Changelog

Installation

npm i lucia
pnpm add lucia
yarn add lucia