Lucia Link: lucia-auth.com > [!IMPORTANT] > Lucia v3 will be deprecated by March 2025. Lucia is now a learning resource on implementing auth from scratch. See the announcement for details…
Lucia
Link: lucia-auth.com
> [!IMPORTANT]
> Lucia v3 will be deprecated by March 2025. Lucia is now a learning resource on implementing auth from scratch. See the announcement for details and migration path. The source code for v3 is available in the v3 branch.
Lucia is an open source project to provide resources on implementing authentication with JavaScript and TypeScript.
The main section is on implementing sessions with your database, library, and framework of choice. Using the API you just created, you can continue learning by going through the tutorials or by referencing one of the fully-fledged examples.
If you have any questions on auth, feel free to ask them in our Discord server or on GitHub Discussions!
Why not a library?
We've found it extremely hard to develop a library that:
1. Supports the many database libraries, ORMs, frameworks, runtimes, and deployment options available in the ecosystem.
2. Provides enough flexibility for the majority of use cases.
3. Does not add significant complexity to projects.
We came to the conclusion that at least for the core of auth - sessions - it's better to teach the code and concepts rather than to try cramming it into a library. The code is very straightforward and shouldn't take more than 10 minutes to write it once you understand it. As an added bonus, it's fully customizable.
Related projects
- The Copenhagen Book: A free online resource covering the various auth concepts in web applications.
- Oslo: Simple, runtime agnostic, and fully-typed packages with minimal dependency for auth and cryptography.
- Arctic: OAuth 2.0 client library with support for 50+ providers.
Disclaimer
All example code in the site is licensed under the Zero-Clause BSD license. You're free to use, copy, modify, and distribute it without any attribution. The license is approved by the Open Source Initiative (OSI) and Google.
Everything else this repository is licensed under the MIT license.
_Copyright © 2024 pilcrow and contributors_
-
lucia
Authentication, simple and clean
★ 10k 11mo agoExplain → -
examples
A collection of example projects built with Lucia
TypeScript ★ 243 1y agoExplain → -
example-nextjs-email-password-2fa
Email and password example with 2FA in Next.js
TypeScript ★ 86 1y agoExplain → -
example-sveltekit-email-password-2fa
Email and password example with 2FA in SvelteKit
TypeScript ★ 63 1y agoExplain → -
example-sveltekit-email-password-webauthn
Email and password example with 2FA and WebAuthn in SvelteKit
TypeScript ★ 62 1y agoExplain → -
example-nextjs-email-password-webauthn
Email and password example with 2FA and WebAuthn in Next.js
TypeScript ★ 54 1y agoExplain → -
example-sveltekit-google-oauth
Google OAuth example in SvelteKit
TypeScript ★ 40 1y agoExplain → -
example-sveltekit-github-oauth
GitHub OAuth example in SvelteKit
TypeScript ★ 29 1y agoExplain → -
example-astro-email-password-2fa
Email and password example with 2FA in Astro
TypeScript ★ 28 1y agoExplain → -
next
No description.
★ 27 1y agoExplain → -
example-astro-email-password-webauthn
Email and password example with 2FA and WebAuthn in Astro
TypeScript ★ 21 1y agoExplain → -
example-nextjs-google-oauth
Google OAuth example in Next.js
TypeScript ★ 20 1y agoExplain → -
example-nextjs-github-oauth
GitHub OAuth example in Next.js
TypeScript ★ 15 1y agoExplain → -
example-astro-github-oauth
GitHub OAuth example in Astro
TypeScript ★ 8 1y agoExplain → -
example-astro-google-oauth
Google OAuth example in Astro
TypeScript ★ 7 1y agoExplain → -
.github
No description.
★ 2 1y agoExplain →
No repos match these filters.