Skip to content

Add passkey authentication events#1392

Merged
ericroberts merged 1 commit intomainfrom
add-passkey-authentication-events
Nov 21, 2025
Merged

Add passkey authentication events#1392
ericroberts merged 1 commit intomainfrom
add-passkey-authentication-events

Conversation

@ericroberts
Copy link
Contributor

Description

A bug in our API prevented these from being returned but also we are missing them from the types in this library. The API bug has been fixed and this fixes the SDK.

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[ ] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

A bug in our API prevented these from being returned but also we are
missing them from the types in this library. The API bug has been fixed
and this fixes the SDK.
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 21, 2025

Greptile Overview

Greptile Summary

Added support for passkey authentication events (authentication.passkey_failed and authentication.passkey_succeeded) to align SDK types with API capabilities after a recent API bug fix.

Key changes:

  • Added AuthenticationPasskeyFailedEvent and AuthenticationPasskeySucceededEvent interfaces with corresponding response types
  • Added both event types to the Event and EventResponse union types
  • Updated the event deserializer to handle passkey authentication cases alongside other authentication methods

The implementation correctly follows the existing pattern used for other authentication event types (password, OAuth, SSO, magic auth) with consistent naming, structure, and placement.

Confidence Score: 5/5

  • This PR is safe to merge with no risk - it's a straightforward addition of missing event types
  • The changes perfectly follow established patterns in the codebase, add no new logic or complexity, only TypeScript type definitions and deserialization cases matching existing authentication events. No security concerns, breaking changes, or edge cases.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
src/common/interfaces/event.interface.ts 5/5 Added passkey authentication event type definitions following the established pattern for authentication events
src/common/serializers/event.serializer.ts 5/5 Added passkey event cases to the deserializer switch statement, properly handling both failed and succeeded events

Sequence Diagram

sequenceDiagram
    participant API as WorkOS API
    participant SDK as WorkOS Node SDK
    participant App as Application Code
    
    Note over API,App: Passkey Authentication Flow
    
    API->>SDK: Webhook Event (EventResponse)
    Note over SDK: authentication.passkey_succeeded<br/>or authentication.passkey_failed
    
    SDK->>SDK: deserializeEvent()
    Note over SDK: Switch on event.event type
    
    SDK->>SDK: Match passkey case
    Note over SDK: Lines 39-40 in serializer
    
    SDK->>SDK: deserializeAuthenticationEvent(event.data)
    Note over SDK: Convert snake_case to camelCase
    
    SDK->>App: Return typed Event object
    Note over App: AuthenticationPasskeyFailedEvent<br/>or AuthenticationPasskeySucceededEvent
    
    App->>App: Handle event with type safety
    Note over App: Access event.data.user,<br/>event.data.organizationId, etc.
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ericroberts ericroberts merged commit e488ea6 into main Nov 21, 2025
5 checks passed
@ericroberts ericroberts deleted the add-passkey-authentication-events branch November 21, 2025 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants