amruthpillai/lucia

Authentication, simple and clean

2

stars

1,498

commits

TypeScript

primary language

Oct 14, 2024

updated

lucia-auth.com

README

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.

Code sample

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

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

Resources

Documentation

Join the Discord server!

Examples

Contributing

Changelog

Installation

npm i lucia
pnpm add lucia
yarn add lucia

Attributions

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

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

Contributors

(top 30 of 135)

pilcrowonpaper

1,244 commits

AdrianGonz97

30 commits

Blastose

12 commits

SkepticMystic

9 commits

amruthpillai/lucia

Authentication, simple and clean

2

stars

1,498

commits

TypeScript

primary language

Oct 14, 2024

updated

lucia-auth.com

README

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.

Code sample

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

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

Resources

Documentation

Join the Discord server!

Examples

Contributing

Changelog

Installation

npm i lucia
pnpm add lucia
yarn add lucia

Attributions

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

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

Contributors

(top 30 of 135)

pilcrowonpaper

1,244 commits

AdrianGonz97

30 commits

Blastose

12 commits

SkepticMystic

9 commits

Languages

TypeScript

100.0%