{"id":19215624,"url":"https://github.com/passlock-dev/passlock","last_synced_at":"2025-05-16T13:02:44.673Z","repository":{"id":235189088,"uuid":"790255669","full_name":"passlock-dev/passlock","owner":"passlock-dev","description":"Svelte / SvelteKit authentication library featuring passkeys, social sign in, user management and more.","archived":false,"fork":false,"pushed_at":"2024-11-27T14:19:02.000Z","size":17598,"stargazers_count":174,"open_issues_count":7,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-15T23:45:42.532Z","etag":null,"topics":["authentication","passkeys","svelte","sveltekit"],"latest_commit_sha":null,"homepage":"https://passlock.dev","language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/passlock-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-04-22T14:48:47.000Z","updated_at":"2025-05-03T23:00:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"57c1445c-af67-4d01-9f57-af8f9e900aa0","html_url":"https://github.com/passlock-dev/passlock","commit_stats":{"total_commits":181,"total_committers":3,"mean_commits":"60.333333333333336","dds":0.03867403314917128,"last_synced_commit":"b277a31a79c3aae31f6699eeeb68f01f9adbd9ff"},"previous_names":["passlock-dev/svelte-passkeys","passlock-dev/ts-clients","passlock-dev/passlock"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passlock-dev%2Fpasslock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passlock-dev%2Fpasslock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passlock-dev%2Fpasslock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passlock-dev%2Fpasslock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/passlock-dev","download_url":"https://codeload.github.com/passlock-dev/passlock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535790,"owners_count":22087396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["authentication","passkeys","svelte","sveltekit"],"created_at":"2024-11-09T14:14:15.920Z","updated_at":"2025-05-16T13:02:44.651Z","avatar_url":"https://github.com/passlock-dev.png","language":"Svelte","readme":"﻿\u003c!-- \nThe pnpm script build:readme replaces tokens \nin README.template.md and outputs to README.md\n--\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/passlock-dev/passlock\"\u003e\n    \u003cimg src=\"https://passlock-assets.b-cdn.net/images/passlock-logo.svg\" alt=\"Passlock logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003ch1 align=\"center\"\u003ePasskeys, Social Login \u0026 More\u003c/h1\u003e\n\n\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cpicture align=\"center\"\u003e\n    \u003csource srcset=\"https://passlock-assets.b-cdn.net/images/client-repo-banner.dark.svg\" media=\"(prefers-color-scheme: dark)\" /\u003e\n    \u003cimg align=\"center\" width=550 height=50 src=\"https://passlock-assets.b-cdn.net/images/client-repo-banner.svg\" /\u003e\n  \u003c/picture\u003e\n  \u003cp align=\"center\"\u003e\n    Typescript library for next generation authentication. Passkeys, Apple login, Google one-tap and more..\n    \u003cbr /\u003e\n    \u003ca href=\"https://passlock.dev\"\u003e\u003cstrong\u003eProject website »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://d1rl0ue18b0151.cloudfront.net\"\u003eDemo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://docs.passlock.dev\"\u003eDocumentation\u003c/a\u003e\n    ·\n    \u003ca href=\"https://docs.passlock.dev/docs/tutorial/introduction\"\u003eTutorial\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003e [!IMPORTANT]  \n\u003e **Building a SvelteKit app?** Run `pnpm create @passlock/sveltekit` and follow the prompts. The CLI wizard will create a skeleton app with support for passkeys, social login, CRUD operations and much more. Choose from Daisy UI, Preline or Shadcn templates. For more details please see the starter app's [README](./packages/create-sveltekit/docs)\n\n## Features\n\nPasskeys and the WebAuthn API are quite complex. I've taken an opinionated approach to simplify things for you. Following the 80/20 principle, I've tried to focus on the features most valuable to developers and users.\n\n1. **🔐 Primary or secondary authentication** - 2FA or a complete replacement for passwords\n\n2. **🚀 Social login** - Supporting Apple \u0026 Google. GitHub coming soon..\n\n3. **☝🏻 Biometrics** - Frictionless facial or fingerprint recognition for your webapps\n\n4. **🖥️ Management console** - Suspend users, disable or revoke passkeys and more..\n\n5. **🕵️ Audit trail** - View a full audit trail for each user\n\n6. **🖥️ Dev console** - Something not working? check the web console for details\n\n7. **👌 Headless components** - You have 100% control over the UI\n\n## Screen recording\n\nhttps://github.com/user-attachments/assets/f1c21242-74cb-4739-8eff-fddb19cb3256\n\n## Screenshots\n\n![SvelteKit template using this library](./README_assets/preline.dark.webp)\n\u003cp align=\"center\"\u003eDemo app using this library for passkey and social login\u003c/p\u003e\n\n![Passlock user profile](./README_assets/console.webp)\n\u003cp align=\"center\"\u003eViewing a user's authentication activity on their profile page\u003c/p\u003e\n\n## Usage\n\n\u003e [!TIP]\n\u003e **SvelteKit users** - Whilst this library is framework agnostic, SvelteKit users may want to check out the [@passlock/sveltekit](./packages/sveltekit/) wrapper This offers several enhancements, including UI components, form action helpers and Superforms support.\n\nUse this library to generate a secure token, representing passkey registration or authentication. Send the token to your backend for verification (see below)\n\n### Register a passkey\n\n```typescript\nimport { Passlock, PasslockError } from '@passlock/client'\n\n// you can find these details in the settings area of your Passlock console\nconst tenancyId = '...'\nconst clientId = '...'\n\nconst passlock = new Passlock({ tenancyId, clientId })\n\n// to register a new passkey, call registerPasskey(). We're using placeholders for \n// the user data. You should grab this from an HTML form, React store, Redux etc.\nconst [email, givenName, familyName] = [\"jdoe@gmail.com\", \"John\", \"Doe\"]\n\n// Passlock doesn't throw but instead returns a union: result | error\nconst result = await passlock.registerPasskey({ email, givenName, familyName })\n\n// ensure we're error free\nif (!PasslockError.isError(result)) {\n  // send the token to your backend (json/fetch or hidden form field etc)\n  console.log('Token: %s', result.token)\n}\n```\n\n### Authenticate using a passkey\n\n```typescript\nimport { Passlock, PasslockError } from '@passlock/client'\n\nconst tenancyId = '...'\nconst clientId = '...'\n\nconst passlock = new Passlock({ tenancyId, clientId })\nconst result = await passlock.authenticatePasskey()\n\nif (!PasslockError.isError(result)) {\n  // send the token to your backend for verification\n  console.log('Token: %s', result.token)\n}\n```\n\n### Backend verification\n\nVerify the token and obtain the passkey registration or authentication details. You can make a simple GET request to `https://api.passlock.dev/{tenancyId}/token/{token}` or use the [@passlock/node][node] library:\n\n```typescript\nimport { Passlock } from '@passlock/node'\n\n// API Keys can be found in your passlock console\nconst passlock = new Passlock({ tenancyId, apiKey })\n\n// token comes from your frontend\nconst principal = await passlock.fetchPrincipal({ token })\n\n// get the user id\nconsole.log(principal.user.id)\n```\n\n## More information\n\nPlease see the [tutorial][tutorial] and [documentation][docs]\n\n[contact]: https://passlock.dev/contact\n[tutorial]: https://docs.passlock.dev/docs/tutorial/introduction\n[docs]: https://docs.passlock.dev\n[node]: https://www.npmjs.com/package/@passlock/node\n[melt]: https://melt-ui.com\n[shadcn]: https://www.shadcn-svelte.com","funding_links":[],"categories":["Components \u0026 Libraries","Security and Authentication","Svelte","Sites"],"sub_categories":["Authentication"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpasslock-dev%2Fpasslock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpasslock-dev%2Fpasslock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpasslock-dev%2Fpasslock/lists"}