{"id":13406780,"url":"https://github.com/yeojz/otplib","last_synced_at":"2026-01-25T17:15:50.391Z","repository":{"id":15992846,"uuid":"18736041","full_name":"yeojz/otplib","owner":"yeojz","description":"One Time Password (OTP) / 2FA for Node.js and Browser - Supports HOTP, TOTP and Google Authenticator","archived":false,"fork":false,"pushed_at":"2026-01-21T16:22:55.000Z","size":4722,"stargazers_count":2168,"open_issues_count":9,"forks_count":141,"subscribers_count":13,"default_branch":"main","last_synced_at":"2026-01-22T04:17:18.099Z","etag":null,"topics":["2fa","authenticator","browser","google-authenticator","hmac","hotp","nodejs","one-time-passwords","otp","two-factor","two-factor-authentication"],"latest_commit_sha":null,"homepage":"https://otplib.yeojz.dev","language":"TypeScript","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/yeojz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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},"funding":{"custom":"https://www.paypal.me/yeojz"}},"created_at":"2014-04-13T18:11:09.000Z","updated_at":"2026-01-21T19:16:07.000Z","dependencies_parsed_at":"2023-01-13T18:39:20.516Z","dependency_job_id":null,"html_url":"https://github.com/yeojz/otplib","commit_stats":null,"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"purl":"pkg:github/yeojz/otplib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeojz%2Fotplib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeojz%2Fotplib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeojz%2Fotplib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeojz%2Fotplib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yeojz","download_url":"https://codeload.github.com/yeojz/otplib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeojz%2Fotplib/sbom","scorecard":{"id":1241327,"data":{"date":"2026-01-05","repo":{"name":"github.com/yeojz/otplib","commit":"cb8b9cb43949c99be95900f87a5f1ad7cd971f1d"},"scorecard":{"version":"v5.4.1-0.20251227023010-525a93017816","commit":"525a93017816fa74238c545bdecac6af16ce00f1"},"score":5.9,"checks":[{"name":"Maintained","score":10,"reason":"22 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#code-review"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#security-policy"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#cii-best-practices"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#packaging"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#license"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/ci.yml:11","Info: topLevel 'contents' permission set to 'read': .github/workflows/deploy-docs.yml:7","Warn: topLevel 'contents' permission set to 'write': .github/workflows/prepare-release.yml:7","Warn: topLevel 'actions' permission set to 'write': .github/workflows/publish-npm.yml:12","Warn: topLevel 'contents' permission set to 'write': .github/workflows/publish-npm.yml:10","Info: topLevel 'contents' permission set to 'read': .github/workflows/smoke-test-packages.yml:12","Warn: topLevel 'checks' permission set to 'write': .github/workflows/smoke-test-packages.yml:13","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#token-permissions"}},{"name":"Branch-Protection","score":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'main'","Info: 'force pushes' disabled on branch 'main'","Warn: 'branch protection settings apply to administrators' is disabled on branch 'main'","Info: 'stale review dismissal' is required to merge on branch 'main'","Warn: branch 'main' does not require approvers","Warn: codeowners review is not required on branch 'main'","Warn: 'last push approval' is disabled on branch 'main'","Warn: no status checks found to merge onto branch 'main'","Info: PRs are required in order to make changes on branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":10,"reason":"project is fuzzed","details":["Info: TypeScriptPropertyBasedTesting integration found: internal/fuzz-tests/src/authenticator.test.ts:8","Info: TypeScriptPropertyBasedTesting integration found: internal/fuzz-tests/src/base32.test.ts:6","Info: TypeScriptPropertyBasedTesting integration found: internal/fuzz-tests/src/cross-plugin.test.ts:2","Info: TypeScriptPropertyBasedTesting integration found: internal/fuzz-tests/src/hotp.test.ts:8","Info: TypeScriptPropertyBasedTesting integration found: internal/fuzz-tests/src/totp.test.ts:8","Info: TypeScriptPropertyBasedTesting integration found: internal/fuzz-tests/src/uri.test.ts:12","Info: TypeScriptPropertyBasedTesting integration found: internal/fuzz-tests/src/authenticator.test.ts:8","Info: TypeScriptPropertyBasedTesting integration found: internal/fuzz-tests/src/base32.test.ts:6","Info: TypeScriptPropertyBasedTesting integration found: internal/fuzz-tests/src/cross-plugin.test.ts:2","Info: TypeScriptPropertyBasedTesting integration found: internal/fuzz-tests/src/hotp.test.ts:8","Info: TypeScriptPropertyBasedTesting integration found: internal/fuzz-tests/src/totp.test.ts:8","Info: TypeScriptPropertyBasedTesting integration found: internal/fuzz-tests/src/uri.test.ts:12"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:79: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:82: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:85: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:106: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:110: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:124: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:127: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:130: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:139: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:145: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:169: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:172: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:175: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:184: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:190: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:203: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:206: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:209: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:224: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:235: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:238: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:241: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-docs.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/deploy-docs.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/deploy-docs.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/deploy-docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-docs.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/deploy-docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-docs.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/deploy-docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-docs.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/deploy-docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/prepare-release.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/prepare-release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/prepare-release.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/prepare-release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/prepare-release.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/prepare-release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/prepare-release.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/prepare-release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/prepare-release.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/prepare-release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/publish-npm.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/publish-npm.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/publish-npm.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/publish-npm.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/publish-npm.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/publish-npm.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-npm.yml:84: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/publish-npm.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/smoke-test-packages.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/smoke-test-packages.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/smoke-test-packages.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/smoke-test-packages.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/smoke-test-packages.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/smoke-test-packages.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/smoke-test-packages.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/yeojz/otplib/smoke-test-packages.yml/main?enable=pin","Warn: containerImage not pinned by hash: docker/Dockerfile.bun:2: pin your Docker image by updating oven/bun:1.3.5-alpine to oven/bun:1.3.5-alpine@sha256:7156fcc0cee0194d390bfaf7f0eeda9a5e383e70cc90f31aad3a2440a033d7dc","Warn: containerImage not pinned by hash: docker/Dockerfile.deno:2: pin your Docker image by updating denoland/deno:1.46.3 to denoland/deno:1.46.3@sha256:5c2dd16fe7794631ce03f3ee48c983fe6240da4c574f4705ed52a091e1baa098","Warn: containerImage not pinned by hash: docker/Dockerfile.node:2: pin your Docker image by updating node:20-alpine to node:20-alpine@sha256:658d0f63e501824d6c23e06d4bb95c71e7d704537c9d9272f488ac03a370d448","Warn: npmCommand not pinned by hash: docker/Dockerfile.bun:6","Warn: downloadThenRun not pinned by hash: docker/Dockerfile.deno:6-10","Warn: npmCommand not pinned by hash: docker/Dockerfile.deno:6-10","Warn: npmCommand not pinned by hash: .github/workflows/smoke-test-packages.yml:44","Info:   0 out of  32 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  17 third-party GitHubAction dependencies pinned","Info:   0 out of   3 containerImage dependencies pinned","Info:   0 out of   3 npmCommand dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/525a93017816fa74238c545bdecac6af16ce00f1/docs/checks.md#sast"}}]},"last_synced_at":"2026-01-12T19:52:19.197Z","repository_id":15992846,"created_at":"2026-01-12T19:52:19.197Z","updated_at":"2026-01-12T19:52:19.197Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28755587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T16:32:25.380Z","status":"ssl_error","status_checked_at":"2026-01-25T16:32:09.189Z","response_time":113,"last_error":"SSL_read: 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":["2fa","authenticator","browser","google-authenticator","hmac","hotp","nodejs","one-time-passwords","otp","two-factor","two-factor-authentication"],"created_at":"2024-07-30T19:02:39.106Z","updated_at":"2026-01-25T17:15:50.385Z","avatar_url":"https://github.com/yeojz.png","language":"TypeScript","funding_links":["https://www.paypal.me/yeojz"],"categories":["TypeScript","browser"],"sub_categories":[],"readme":"\u003cpicture\u003e\n  \u003csource srcset=\"/assets/otplib-w.svg\" media=\"(prefers-color-scheme: dark)\"\u003e\n  \u003cimg src=\"/assets/otplib-b.svg\" alt=\"otplib-logo\"  width=\"170\"\u003e\n\u003c/picture\u003e\n\n# otplib-repo\n\n[![npm version](https://img.shields.io/npm/v/otplib.svg)](https://www.npmjs.com/package/otplib)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Downloads](https://img.shields.io/npm/dm/otplib.svg)](https://www.npmjs.com/package/otplib)\n[![Code Repository](https://img.shields.io/github/stars/yeojz/otplib?style=flat)](https://github.com/yeojz/otplib)\n\nTypeScript-first library for HOTP and TOTP / Authenticator with multi-runtime (Node, Bun, Deno, Browser) support via plugins.\n\nA web based demo is available at [https://otplib.yeojz.dev](https://otplib.yeojz.dev).\n\n## Features\n\n- **Zero Configuration** - Works out of the box with sensible defaults\n- **RFC Compliant** - RFC 6238 (TOTP) and RFC 4226 (HOTP)\n- **TypeScript-First** - Full type definitions\n- **Google Authenticator Compatible** - Full otpauth:// URI support\n- **Plugin Interface** - Flexible plugin system for customising your cryptographic and base32 requirements (if you want to deviate from the defaults)\n- **Cross-platform** - Tested against Node.js, Bun, Deno, and browsers\n\n## Breaking Changes (v13)\n\n\u003e [!IMPORTANT]  \n\u003e v13 is a complete rewrite with breaking changes:\n\u003e\n\u003e - **New**\n\u003e   - **Security-audited plugins** — Default crypto uses `@noble/hashes` and `@scure/base`, both independently audited\n\u003e   - **Cross-platform defaults** — Works out-of-the-box in Node.js, Bun, Deno, and browsers\n\u003e   - **Full type safety** — Comprehensive TypeScript types with strict mode from the ground up\n\u003e   - **Async-first API** — All operations are async by default; sync variants available for compatible plugins\n\u003e - **Removed**\n\u003e   - **Separate authenticator package** — TOTP now covers all authenticator functionality\n\u003e   - **Outdated plugins** — Legacy crypto adapters removed in favor of modern, audited alternatives\n\u003e\n\u003e See [Migration Guide](https://otplib.yeojz.dev/guide/v12-adapter.html) for details.\n\n## Quick Start\n\n```bash\n# Node\nnpm install otplib\npnpm add otplib\nyarn add otplib\n```\n\n```bash\n# Other runtimes\nbun add otplib\ndeno install npm:otplib\n```\n\n```typescript\nimport { generateSecret, generate, verify, generateURI } from \"otplib\";\n\n// Generate a secret\nconst secret = generateSecret();\n\n// Generate a TOTP token\nconst token = await generate({ secret });\n\n// Verify a token\nconst result = await verify({ secret, token });\nconsole.log(result.valid); // true\n```\n\n## Packages\n\n| Package                                                         | Version                                                                                                                           | Downloads                                                                                                                          |\n| :-------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------- |\n| [`otplib`](./packages/otplib)                                   | [![npm](https://img.shields.io/npm/v/otplib.svg)](https://www.npmjs.com/package/otplib)                                           | [![npm](https://img.shields.io/npm/dm/otplib.svg)](https://www.npmjs.com/package/otplib)                                           |\n| [`@otplib/core`](./packages/core)                               | [![npm](https://img.shields.io/npm/v/@otplib/core.svg)](https://www.npmjs.com/package/@otplib/core)                               | [![npm](https://img.shields.io/npm/dm/@otplib/core.svg)](https://www.npmjs.com/package/@otplib/core)                               |\n| [`@otplib/totp`](./packages/totp)                               | [![npm](https://img.shields.io/npm/v/@otplib/totp.svg)](https://www.npmjs.com/package/@otplib/totp)                               | [![npm](https://img.shields.io/npm/dm/@otplib/totp.svg)](https://www.npmjs.com/package/@otplib/totp)                               |\n| [`@otplib/hotp`](./packages/hotp)                               | [![npm](https://img.shields.io/npm/v/@otplib/hotp.svg)](https://www.npmjs.com/package/@otplib/hotp)                               | [![npm](https://img.shields.io/npm/dm/@otplib/hotp.svg)](https://www.npmjs.com/package/@otplib/hotp)                               |\n| [`@otplib/uri`](./packages/uri)                                 | [![npm](https://img.shields.io/npm/v/@otplib/uri.svg)](https://www.npmjs.com/package/@otplib/uri)                                 | [![npm](https://img.shields.io/npm/dm/@otplib/uri.svg)](https://www.npmjs.com/package/@otplib/uri)                                 |\n| [`@otplib/plugin-base32-scure`](./packages/plugin-base32-scure) | [![npm](https://img.shields.io/npm/v/@otplib/plugin-base32-scure.svg)](https://www.npmjs.com/package/@otplib/plugin-base32-scure) | [![npm](https://img.shields.io/npm/dm/@otplib/plugin-base32-scure.svg)](https://www.npmjs.com/package/@otplib/plugin-base32-scure) |\n| [`@otplib/plugin-crypto-noble`](./packages/plugin-crypto-noble) | [![npm](https://img.shields.io/npm/v/@otplib/plugin-crypto-noble.svg)](https://www.npmjs.com/package/@otplib/plugin-crypto-noble) | [![npm](https://img.shields.io/npm/dm/@otplib/plugin-crypto-noble.svg)](https://www.npmjs.com/package/@otplib/plugin-crypto-noble) |\n| [`@otplib/plugin-crypto-node`](./packages/plugin-crypto-node)   | [![npm](https://img.shields.io/npm/v/@otplib/plugin-crypto-node.svg)](https://www.npmjs.com/package/@otplib/plugin-crypto-node)   | [![npm](https://img.shields.io/npm/dm/@otplib/plugin-crypto-node.svg)](https://www.npmjs.com/package/@otplib/plugin-crypto-node)   |\n| [`@otplib/plugin-crypto-web`](./packages/plugin-crypto-web)     | [![npm](https://img.shields.io/npm/v/@otplib/plugin-crypto-web.svg)](https://www.npmjs.com/package/@otplib/plugin-crypto-web)     | [![npm](https://img.shields.io/npm/dm/@otplib/plugin-crypto-web.svg)](https://www.npmjs.com/package/@otplib/plugin-crypto-web)     |\n\n## Documentation\n\nRefer to the [Getting Started Guide](https://otplib.yeojz.dev/guide/getting-started), or check out the other sections in the guide:\n\n- [Advanced Usage](https://otplib.yeojz.dev/guide/advanced-usage)\n- [Runtime Compatibility](https://otplib.yeojz.dev/guide/runtime-compatibility)\n- [Security Considerations](https://otplib.yeojz.dev/guide/security)\n- [API Reference](https://otplib.yeojz.dev/api/)\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup and guidelines.\n\n## AI Usage Disclosure\n\nSince v13, parts of the codebase, tests, and documentation have been refined with AI assistance, with all outputs reviewed by humans. See [CONTRIBUTING.md](./CONTRIBUTING.md#ai-usage-guidelines) for guidelines.\n\n## License\n\n[MIT](./LICENSE) © 2026 Gerald Yeo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeojz%2Fotplib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeojz%2Fotplib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeojz%2Fotplib/lists"}