{"id":43270538,"url":"https://github.com/treeder/passkeys","last_synced_at":"2026-02-01T15:41:24.732Z","repository":{"id":285199578,"uuid":"957317044","full_name":"treeder/passkeys","owner":"treeder","description":"Passkeys library to make implementing passkeys easy. ","archived":false,"fork":false,"pushed_at":"2026-01-13T18:31:42.000Z","size":151,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-13T20:54:07.684Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/treeder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-30T03:57:15.000Z","updated_at":"2026-01-13T18:31:46.000Z","dependencies_parsed_at":"2025-08-08T17:29:14.645Z","dependency_job_id":null,"html_url":"https://github.com/treeder/passkeys","commit_stats":null,"previous_names":["treeder/pass-keys2"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/treeder/passkeys","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeder%2Fpasskeys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeder%2Fpasskeys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeder%2Fpasskeys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeder%2Fpasskeys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/treeder","download_url":"https://codeload.github.com/treeder/passkeys/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeder%2Fpasskeys/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28981454,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T15:35:50.179Z","status":"ssl_error","status_checked_at":"2026-02-01T15:35:38.075Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-01T15:41:24.568Z","updated_at":"2026-02-01T15:41:24.728Z","avatar_url":"https://github.com/treeder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Easy to use Passkeys library\n\nPasswordless email and passkey based authentication.\n\nThe objective of this is to make it as easy as possible to add passkeys to your app. It's quite complicated\nto get right so hopefully this will help you.\n\nThis package includes backend code, frontend code and ready to go frontend web components.\n\n## Demo\n\nCheck out this demo to see it in action.\n\n[Demo](https://passkeys-3nt.pages.dev/)\n\n## Flow\n\n- New user will enter email address and get sent a magic sign in link.\n- They click the link to sign in (common flow).\n- After they are signed in, they can then create a passkey (or not, this is optional, users can continue using email sign in if they prefer).\n- After a passkey is created, they can use it the next time they try to login instead of using the email way.\n\n## Usage\n\nNOTE: \u003cb\u003ePlease create an issue if you notice anything not working in the docs\u003c/b\u003e.\n\n### Backend:\n\n```sh\nnpm install treeder/passkeys\n```\n\nThen create a `Passkeys` object to handle everything for you:\n\n```js\nlet passkeys = new Passkeys({\n  appName: 'Passkeys demo', // the name of your app\n  baseURL: `${hostURL(c)}/auth`, // base URL of your app including path up to the endpoints below\n  afterEmailVerifyURL: `${hostURL(c)}/signin`, // URL to redirect to after email verification\n  kv: c.env.KV, // a key value store with 2 functions: `put(key, value)` and `get(key)`\n  mailer: globals.mailer, // a mailer with a send function: `send({to: \"email\", subject: \"subject\", body: \"body\"})`\n  logger: c.data.logger, // (optional) a logger with a log function: `log(message)`\n  // Callbacks you can use to update your database, see below\n})\n\n// Then based on the path after the `baseURL` above:\nif (p[0] == 'email') {\n  if (p[1] == 'start') {\n    return await passkeys.emailStart(c)\n  }\n  if (p[1] == 'verify') {\n    return await passkeys.emailVerify(c)\n  }\n} else if (p[0] == 'passkeys') {\n  if (p[1] == 'new') {\n    return await passkeys.new(c)\n  }\n  if (p[1] == 'start') {\n    return await passkeys.start(c)\n  }\n  if (p[1] == 'create') {\n    return await passkeys.create(c)\n  }\n  if (p[1] == 'verify') {\n    return await passkeys.verify(c)\n  }\n  if (p[1] == 'check') {\n    return await passkeys.check(c)\n  }\n}\n```\n\nCallbacks you can use to update your database:\n\n- emailStart({email}): Called when user first enters email, either to sign up or sign in. Good chance to create the\n  user and get/set a user ID. If you return an object with a `userId` field, that userId will be stored in the session and passed to emailVerified below. If you don't do this, a new unique ID will be assigned.\n- emailSend({ userId, email, token, url }): Lets you send your own verification email. Send it to `email` and include the `url` in the email for the user to click to verify.\n- emailVerified({email, userId}): Called after user clicks the verification link in their email and email is verified.\n- passkeyVerified({email, userId}): Called after user logs in with a passkey.\n\nYou'll need 6 endpoints:\n\n- /email/start\n- /email/verify\n- /passkeys/new\n- /passkeys/create\n- /passkeys/start\n- /passkeys/verify\n\nSee an example of adding these endpoints [here](functions/v2/auth/[[catchall]].js)\n\n### Frontend\n\nThere is a [pre-built component](/public/components/sign-in.js) you can just drop in and use or copy it to customize how you want.\n\n#### Using the pre-built component\n\nYou can use this to get started quick, then if you need to you can copy it and make changes.\n\nOn your sign in page, add:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import 'passkeys/public/components/sign-in.js'\n\u003c/script\u003e\n\n\u003csign-in baseURL=\"/auth\"\u003e\u003c/sign-in\u003e\n```\n\nAttributes:\n\n- baseURL:\n\nUsing a CDN:\n\nIf you'd like to use a CDN rather than your bundler, the above part stays the same, but add this importmap between the `\u003chead\u003e` tags of your site:\n\n```html\n\u003cscript type=\"importmap\"\u003e\n  {\n    \"imports\": {\n      \"lit\": \"https://cdn.jsdelivr.net/npm/lit@3/index.js\",\n      \"lit/\": \"https://cdn.jsdelivr.net/npm/lit@3/\",\n      \"@lit/localize\": \"https://cdn.jsdelivr.net/npm/@lit/localize/lit-localize.js\",\n      \"@lit/reactive-element\": \"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1/reactive-element.js\",\n      \"@lit/reactive-element/\": \"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1/\",\n      \"lit-element/lit-element.js\": \"https://cdn.jsdelivr.net/npm/lit-element@4/lit-element.js\",\n      \"lit-html\": \"https://cdn.jsdelivr.net/npm/lit-html@3/lit-html.js\",\n      \"lit-html/\": \"https://cdn.jsdelivr.net/npm/lit-html@3/\",\n      \"material/\": \"https://cdn.jsdelivr.net/gh/treeder/material@2.1/\",\n      \"api\": \"https://cdn.jsdelivr.net/gh/treeder/api@0/api.js\",\n      \"passkeys/\": \"https://cdn.jsdelivr.net/gh/treeder/passkeys@1/\"\n    }\n  }\n\u003c/script\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreeder%2Fpasskeys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftreeder%2Fpasskeys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreeder%2Fpasskeys/lists"}