Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Commit 683e165

Browse files
committed
Update deprecation notice.
1 parent f439951 commit 683e165

File tree

1 file changed

+42
-3
lines changed

1 file changed

+42
-3
lines changed

README.md

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,47 @@
1-
⚠️ ⚠️ ⚠️
1+
# ⚠️ `@github/webauthn-json` is deprecated
22

3-
WebAuthn-json has been sunset. Now that [all major browsers support WebAuthn](https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API#browser_compatibility) we recommend invoking the native APIs
3+
As of March 2025, stable versions of all major browsers now support the following methods:
44

5-
⚠️ ⚠️ ⚠️
5+
- [`PublicKeyCredential.parseCreationOptionsFromJSON(…)`](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/parseCreationOptionsFromJSON_static)
6+
- [`PublicKeyCredential.parseRequestOptionsFromJSON(…)`](https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredential/parseCreationOptionsFromJSON_static)
7+
8+
By design, these are compatible with `@github/webauthn-json` encoding, so you can use them as a drop-in substitute. We strongly recommend doing so, since:
9+
10+
- The browser-native JSON parsing functions are increasingly receiving fields and features (such as user-agent hints and the `prf` extension) that `@github/webauthn-json` will never receive.
11+
- Removing `@github/webauthn-json` from your codebase will remove code from your authentication pages, reducing load times for your users and reducing the chance you will need to debug issues.
12+
13+
If you need to support older browsers in the short-term, consider loading this library only as a fallback:
14+
15+
```js
16+
async function register() {
17+
const parseCreationOptionsFromJSON =
18+
PublicKeyCredential.parseCreationOptionsFromJSON ??
19+
/* @type PublicKeyCredential.parseCreationOptionsFromJSON */
20+
(await import("@github/webauthn-json/browser-ponyfill")).parseCreationOptionsFromJSON;
21+
22+
const publicKey = parseCreationOptionsFromJSON({ /**/ });
23+
return navigator.credentials.create({publicKey});
24+
}
25+
26+
async function authenticate() {
27+
const parseRequestOptionsFromJSON =
28+
PublicKeyCredential.parseRequestOptionsFromJSON ??
29+
/* @type PublicKeyCredential.parseRequestOptionsFromJSON */
30+
(await import("@github/webauthn-json/browser-ponyfill")).parseRequestOptionsFromJSON;
31+
32+
const publicKey = parseRequestOptionsFromJSON({ /**/ });
33+
return navigator.credentials.get({publicKey});
34+
}
35+
```
36+
37+
<br>
38+
<br>
39+
40+
This project's old README contents are below:
41+
42+
<br>
43+
44+
--------
645
746
# `@github/webauthn-json`
847

0 commit comments

Comments
 (0)