Skip to content

pilcrowOnPaper/lucia

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
May 3, 2023 21:54
April 26, 2023 09:17
May 3, 2023 21:54
May 3, 2023 21:54
May 3, 2023 21:54
January 18, 2023 09:10
December 22, 2022 22:33
October 14, 2022 14:11
July 27, 2022 01:26
April 9, 2023 08:07
April 30, 2023 13:16
January 7, 2023 10:00

Lucia

Lucia is a simple and flexible user and session management library that provides an abstraction layer between your app and your database. It's bare-bones by design, keeping everything easy to use and understand. Get started by reading the introduction page.

Code sample

Working with Lucia looks something like this. In the code below, you're creating a new user with a email/password method, creating a new session, and creating a cookie that you can set it to the user.

const user = await auth.createUser({
	primaryKey: {
		providerId: "email",
		providerUserId: email,
		password
	},
	attributes: {
		email,
		username
	}
});
const session = await auth.createSession(user.userId);
const sessionCookie = auth.createSessionCookie(session);

Resources

Documentation

Join the Discord server!

Changelog

CONTRIBUTING.md

Installation

npm i lucia-auth
pnpm add lucia-auth
yarn add lucia-auth

Attributions

This project would not have been possible without our contributors, thank you!

Logo by @dawidmachon, licensed under CC BY-NC-SA 4.0.