Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cotyhamilton/lucia-auth-adapter-deno-kv
lucia adapter for deno kv on deno
https://github.com/cotyhamilton/lucia-auth-adapter-deno-kv
Last synced: 2 days ago
JSON representation
lucia adapter for deno kv on deno
- Host: GitHub
- URL: https://github.com/cotyhamilton/lucia-auth-adapter-deno-kv
- Owner: cotyhamilton
- Created: 2024-01-31T04:43:03.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-05-09T02:46:40.000Z (9 months ago)
- Last Synced: 2024-11-23T00:19:43.112Z (2 months ago)
- Language: TypeScript
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lucia auth adapter deno kv
[![JSR](https://jsr.io/badges/@cotyhamilton/lucia-adapter-denokv)](https://jsr.io/@cotyhamilton/lucia-adapter-denokv)
compatible with `npm:lucia@3`
example implementation: https://github.com/cotyhamilton/deno-auth-lucia
## usage
```sh
deno add @cotyhamilton/lucia-adapter-denokv
deno add npm:lucia@3
``````ts
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
- https://lucia-auth.com
- https://docs.deno.com/deploy/kv/manual/