Skip to main content

A Deno KV adapter for lucia authentication

Works with
It is unknown whether this package works with Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Browsers
JSR Score
100%
Published
3 weeks ago (0.2.1)

lucia auth adapter deno kv

JSR

compatible with npm:lucia@3

example implementation: https://github.com/cotyhamilton/deno-auth-lucia

usage

deno add @cotyhamilton/lucia-adapter-denokv
deno add npm:lucia@3
import { Lucia } from "lucia";
import { DenoKVAdapter } from "@cotyhamilton/lucia-adapter-denokv";

const kv = await Deno.openKv();

export const lucia = new Lucia(new DenoKVAdapter(kv), {
  getUserAttributes: (attributes) => {
    return {
      // attributes has the type of DatabaseUserAttributes
      name: attributes.name,
    };
  },
});

declare module "lucia" {
  interface Register {
    Lucia: typeof lucia;
    DatabaseUserAttributes: DatabaseUserAttributes;
  }
}

interface DatabaseUserAttributes {
  name: string;
}

reference

Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @cotyhamilton/lucia-adapter-denokv

Import symbol

import * as mod from "@cotyhamilton/lucia-adapter-denokv";

Add Package

npx jsr add @cotyhamilton/lucia-adapter-denokv

Import symbol

import * as mod from "@cotyhamilton/lucia-adapter-denokv";

Add Package

yarn dlx jsr add @cotyhamilton/lucia-adapter-denokv

Import symbol

import * as mod from "@cotyhamilton/lucia-adapter-denokv";

Add Package

pnpm dlx jsr add @cotyhamilton/lucia-adapter-denokv

Import symbol

import * as mod from "@cotyhamilton/lucia-adapter-denokv";

Add Package

bunx jsr add @cotyhamilton/lucia-adapter-denokv

Import symbol

import * as mod from "@cotyhamilton/lucia-adapter-denokv";