Repository navigation
feat: SDK update for version 18.4.0 - #120
Conversation
🔵 Tier A · Mergeable after minor fixes
Adds passkey registration, sign-in, management, and project-policy methods, along with the associated response models. Updates the SDK version metadata and changelog and adds examples for the new APIs.
Fix with agent prompt### Issue 1
src/services/account.ts:2798
**Document parsing the registration options before WebAuthn**
The returned `publicKey` is JSON-form WebAuthn options, so its encoded challenge and user ID must be converted with `PublicKeyCredential.parseCreationOptionsFromJSON()` before calling `navigator.credentials.create()`; passing the raw values will fail. The model documentation already describes this conversion, but this method's guidance omits it.
### Issue 2
src/services/account.ts:5669
**Document parsing the sign-in options before WebAuthn**
The returned `publicKey` is JSON-form WebAuthn options, so its encoded challenge must be converted with `PublicKeyCredential.parseRequestOptionsFromJSON()` before calling `navigator.credentials.get()`; passing the raw values will fail. Please include that step in the sign-in instructions.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.📂 Walkthrough · 11
Reviewed |
| } | ||
|
|
||
| /** | ||
| * Start registering a passkey for the currently logged in user. The session must have signed in or completed an MFA challenge within the last 10 minutes. Pass the returned `publicKey` options to `navigator.credentials.create()`, then complete the registration with [Update passkey verification](/docs/references/cloud/client-web/account#updatePasskeyVerification). The passkey stays pending until verified, and the challenge expires after 5 minutes. |
There was a problem hiding this comment.
Document parsing the registration options before WebAuthn
The returned publicKey is JSON-form WebAuthn options, so its encoded challenge and user ID must be converted with PublicKeyCredential.parseCreationOptionsFromJSON() before calling navigator.credentials.create(); passing the raw values will fail. The model documentation already describes this conversion, but this method's guidance omits it.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/services/account.ts
Line: 2798
Comment:
**Document parsing the registration options before WebAuthn**
The returned `publicKey` is JSON-form WebAuthn options, so its encoded challenge and user ID must be converted with `PublicKeyCredential.parseCreationOptionsFromJSON()` before calling `navigator.credentials.create()`; passing the raw values will fail. The model documentation already describes this conversion, but this method's guidance omits it.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · documentation · Reply if this doesn't apply.
| } | ||
|
|
||
| /** | ||
| * Start signing in with a passkey. No email or user ID is needed: pass the returned `publicKey` options to `navigator.credentials.get()` and the user picks one of their passkeys. Then call [Update passkey token](/docs/references/cloud/client-web/account#updatePasskeyToken) with the credential to receive a token, and exchange it with [Create session](/docs/references/cloud/client-web/account#createSession). The challenge expires after 5 minutes. |
There was a problem hiding this comment.
Document parsing the sign-in options before WebAuthn
The returned publicKey is JSON-form WebAuthn options, so its encoded challenge must be converted with PublicKeyCredential.parseRequestOptionsFromJSON() before calling navigator.credentials.get(); passing the raw values will fail. Please include that step in the sign-in instructions.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/services/account.ts
Line: 5669
Comment:
**Document parsing the sign-in options before WebAuthn**
The returned `publicKey` is JSON-form WebAuthn options, so its encoded challenge must be converted with `PublicKeyCredential.parseRequestOptionsFromJSON()` before calling `navigator.credentials.get()`; passing the raw values will fail. Please include that step in the sign-in instructions.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · documentation · Reply if this doesn't apply.
This PR contains updates to the SDK for version 18.4.0.
What's Changed
accountpasskey methodslistPasskeys,createPasskey,getPasskey,updatePasskey,deletePasskeyandupdatePasskeyVerificationaccount.createPasskeyTokenandaccount.updatePasskeyTokenfor passkey sign-inusers.listPasskeys,users.getPasskey,users.updatePasskeyandusers.deletePasskeyproject.updatePasskeyPolicyto configure passkey sign-inPasskey,PasskeyList,PasskeyChallengeandTokenSecretmodelsPasskeys only, patched onto
main: the diff of the SDK generated with and without the passkey methods, three-way merged onto the release. Everything else on the release is unchanged, including itsX-Appwrite-Response-Format.