github/webauthn-json

Export `PublicKeyCredentialRequestOptionsJSON`

dartess opened this issue · 3 comments

Please add export type PublicKeyCredentialRequestOptionsJSON, we prepare it using a separate method.

I think you're looking for CredentialRequestOptionsJSON?

import { type CredentialRequestOptionsJSON, get, create } from "@github/webauthn-json";

const r: CredentialRequestOptionsJSON = { /* … */ };
console.log(await get(r));

No, but I was a little hasty in the code review and didn’t get into the code. We just used CredentialRequestOptionsJSON['publicKey'] instead of PublicKeyCredentialRequestOptionsJSON. Sorry! 🙏

We just used CredentialRequestOptionsJSON['publicKey'] instead of PublicKeyCredentialRequestOptionsJSON.

Yeah, this is the way to get the type of a field if you really need. Glad it worked out for you!