lucia

createKeyId()#

Creates key id (KeySchema.id).

const createKeyId: (providerId: string, providerUserId: string) => string;
Parameters#
nametypedescription
providerIdstringKey provider id
providerUserIdstringKey provider user id
Returns#
typedescription
stringKey id

Default session cookie name.

import { DEFAULT_SESSION_COOKIE_NAME } from "lucia";
const DEFAULT_SESSION_COOKIE_NAME = "auth_session";

lucia()#

Initialize Lucia and create a new Auth instance.

import { lucia } from "lucia";
const lucia: (config: Configuration) => Auth;
Parameters#
nametypedescription
configConfigurationLucia configuration
Returns#
type
Auth

LuciaError()#

Error class thrown by Lucia. See reference for LuciaError.

import { LuciaError } from "lucia";
Example#
try {
	// ...
} catch (e) {
	if (e instanceof LuciaError) {
		// Lucia error
	}
}