{"_id":"@bun-win32/webauthn","_rev":"3-60c9dee9e68c0ced682580c592ed7fba","name":"@bun-win32/webauthn","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/webauthn","version":"1.0.0","keywords":["bun","ffi","win32","windows","webauthn","passkey","fido2","windows-hello","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/webauthn@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"674d102108dd4240d21839831ef3fe8b57c0e8b0","tarball":"https://registry.npmjs.org/@bun-win32/webauthn/-/webauthn-1.0.0.tgz","fileCount":6,"integrity":"sha512-R0qM7NKxwohgzgODjbE+1PJJNnfQ9kDB+Zk+5LhWS3hxyW/yaFYvr4czlkL0Zgkfsg+XF3uLw+v2TFDvMyl5/A==","signatures":[{"sig":"MEUCIBb3M0pZC/17pLB0WoApe4XWCqgbA9w6obH9SKHK5fi5AiEAhOlIeoesfGup2aNVVnhKN5sFlso9V5hBurtBauC9TdE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24617},"main":"./index.ts","type":"module","module":"index.ts","shasum":"674d102108dd4240d21839831ef3fe8b57c0e8b0","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:passkey-ceremony":"bun ./example/passkey-ceremony.ts","example:authenticator-diagnostic":"bun ./example/authenticator-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-R0qM7NKxwohgzgODjbE+1PJJNnfQ9kDB+Zk+5LhWS3hxyW/yaFYvr4czlkL0Zgkfsg+XF3uLw+v2TFDvMyl5/A==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/webauthn"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 WEBAUTHN bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/webauthn_1.0.0_1780539758371_0.018486502909601077","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/webauthn","version":"2.0.0","keywords":["bun","ffi","win32","windows","webauthn","passkey","fido2","windows-hello","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/webauthn@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"b3dc2a42b5cc422c9c58774d25bb07771c88aa61","tarball":"https://registry.npmjs.org/@bun-win32/webauthn/-/webauthn-2.0.0.tgz","fileCount":6,"integrity":"sha512-JvC0MiHN+X8LoNGplWK/+XIG/K3bZBALMU+Zxn83vFryvFUGoIbhw/0zZW+EvJpWcNodvpNbzbyN0ZSG2aI9+Q==","signatures":[{"sig":"MEYCIQCUYSf8+5FG+bhGB79Zuw+QCDjx5L0chqWc5lJ4LBYpbgIhAK3hjCCZ+w/4TNjUCbiCl86XQI90DSOIOboqWuEVTK0c","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25927},"main":"./index.ts","type":"module","module":"index.ts","shasum":"b3dc2a42b5cc422c9c58774d25bb07771c88aa61","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:passkey-ceremony":"bun ./example/passkey-ceremony.ts","example:authenticator-diagnostic":"bun ./example/authenticator-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-JvC0MiHN+X8LoNGplWK/+XIG/K3bZBALMU+Zxn83vFryvFUGoIbhw/0zZW+EvJpWcNodvpNbzbyN0ZSG2aI9+Q==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/webauthn"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 WEBAUTHN bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/webauthn_2.0.0_1782435982743_0.36826221538889214","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 WEBAUTHN bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/webauthn","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/webauthn"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","webauthn","passkey","fido2","windows-hello","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:passkey-ceremony":"bun ./example/passkey-ceremony.ts","example:authenticator-diagnostic":"bun ./example/authenticator-diagnostic.ts"},"_id":"@bun-win32/webauthn@2.0.1","_integrity":"sha512-WaoY6NsiAmit6dNo0WxbU471P7H+JDfhASPRHR5ATU9uYR/MiaBBs1eG5JjaK1hlvFXCJUe0d4fr9wb6qrzYog==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"37693abb12cbcf8dc17bd737e209091b4182cd65","dist":{"integrity":"sha512-WaoY6NsiAmit6dNo0WxbU471P7H+JDfhASPRHR5ATU9uYR/MiaBBs1eG5JjaK1hlvFXCJUe0d4fr9wb6qrzYog==","shasum":"37693abb12cbcf8dc17bd737e209091b4182cd65","tarball":"https://registry.npmjs.org/@bun-win32/webauthn/-/webauthn-2.0.1.tgz","fileCount":6,"unpackedSize":25927,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDAxqa2JUhMMFjCTMvkreRwPj9Cnu6Dne0fhMwA6JeMcQIgHOoJaHWo4KhIkKMQxqtOWvxDzE8EAxCMHMkFoPwKg8w="}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/webauthn_2.0.1_1782438207899_0.02689816799461142"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-04T02:22:38.210Z","modified":"2026-06-26T01:43:28.200Z","1.0.0":"2026-06-04T02:22:38.516Z","2.0.0":"2026-06-26T01:06:22.901Z","2.0.1":"2026-06-26T01:43:28.047Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","webauthn","passkey","fido2","windows-hello","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/webauthn"},"description":"Zero-dependency, zero-overhead Win32 WEBAUTHN bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/webauthn\n\nZero-dependency, zero-overhead Win32 WebAuthn bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/webauthn` exposes the `webauthn.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Webauthn`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\n`webauthn.dll` is the Windows WebAuthn / FIDO2 platform API: drive the Windows platform authenticator (Windows Hello biometrics + TPM-backed passkeys) and roaming security keys directly from a desktop, CLI, or Electron app — `WebAuthNAuthenticatorMakeCredential` (passkey registration), `WebAuthNAuthenticatorGetAssertion` (passkey sign-in), platform-credential enumeration/deletion, cancellation, and W3C `DOMException` error mapping. This is the native ceremony, not a crypto primitive.\n\nThe bindings are strongly typed for a smooth DX in TypeScript.\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `webauthn.dll` (passkeys, FIDO2, Windows Hello platform authenticator).\n- In-source docs in `structs/Webauthn.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Webauthn.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Webauthn.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 (1903+) or later\n\n## Installation\n\n```sh\nbun add @bun-win32/webauthn\n```\n\n## Quick Start\n\n```ts\nimport Webauthn from '@bun-win32/webauthn';\n\n// Which API version (and therefore which structures/features) is available?\nconsole.log('WebAuthn API version:', Webauthn.WebAuthNGetApiVersionNumber());\n\n// Is Windows Hello (a user-verifying platform authenticator) usable?\nconst available = Buffer.alloc(4); // BOOL\nif (Webauthn.WebAuthNIsUserVerifyingPlatformAuthenticatorAvailable(available.ptr!) === 0) {\n  console.log('Windows Hello available:', available.readInt32LE(0) !== 0);\n}\n\n// Mint a per-operation cancellation GUID (pass it in *Options to cancel later).\nconst guid = Buffer.alloc(16);\nif (Webauthn.WebAuthNGetCancellationId(guid.ptr!) === 0) {\n  console.log('Cancellation Id:', guid.toString('hex'));\n}\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples:\n\n```sh\nbun run example/passkey-ceremony.ts\nbun run example/authenticator-diagnostic.ts\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Webauthn.Preload()`.\n- `WebAuthNAuthenticatorMakeCredential` / `WebAuthNAuthenticatorGetAssertion` need a valid foreground `HWND` (the ceremony UI parents to it) and block the calling thread until the user completes or cancels the Windows Hello prompt.\n- Pair `WebAuthNAuthenticatorMakeCredential` with `WebAuthNFreeCredentialAttestation`, and `WebAuthNAuthenticatorGetAssertion` with `WebAuthNFreeAssertion`. Pair `WebAuthNGetPlatformCredentialList` with `WebAuthNFreePlatformCredentialList`.\n- `WebAuthNGetPlatformCredentialList` uses the sizing-aware out-pointer pattern: pass a `PWEBAUTHN_CREDENTIAL_DETAILS_LIST*` cell, then walk `ppCredentialDetails`.\n- Result codes are `HRESULT` (`0` = `S_OK`); decode failures with `WebAuthNGetErrorName` (W3C error name) and `WebAuthNGetW3CExceptionDOMError` (canonical DOM error).\n- `WebAuthNGetApiVersionNumber` gates which structure versions are valid — check it before populating versioned option structs.\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}