Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: workos/workos-node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.81.0
Choose a base ref
...
head repository: workos/workos-node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.82.0
Choose a head ref
  • 2 commits
  • 7 files changed
  • 1 contributor

Commits on Jan 9, 2026

  1. Add context field to Event interface (#1442)

    ## Summary
    
    - Add optional `context` field to `EventBase` and `EventResponseBase`
    interfaces
    - Pass through `context` in `deserializeEvent` serializer
    - Add test coverage for context field deserialization
    
    The `listEvents` API returns a `context` object containing metadata like
    `client_id`, but the deserializer was dropping it.
    
    ## Test plan
    
    - [x] Unit tests pass with context field in test fixtures
    - [x] Manual verification against live API confirms context is now
    returned
    - [x] Build and lint pass
    
    <details>
    <summary>Manual verification script</summary>
    
    Save as `scripts/verify-context-field.ts` and run with `npx tsx
    scripts/verify-context-field.ts`:
    
    ```typescript
    /**
     * Manual verification script for issue #1415
     * Tests that the context field is properly deserialized from listEvents API
     *
     * Usage: npx tsx scripts/verify-context-field.ts
     *
     * Requires WORKOS_API_KEY environment variable to be set
     */
    
    import { WorkOS } from '../src/index';
    
    async function main() {
      const apiKey = process.env.WORKOS_API_KEY;
      if (!apiKey) {
        console.error('Error: WORKOS_API_KEY environment variable is required');
        process.exit(1);
      }
    
      const workos = new WorkOS(apiKey);
    
      console.log('Fetching events with authentication events...\n');
    
      try {
        // Fetch authentication events which typically have context with client_id
        const result = await workos.events.listEvents({
          events: [
            'authentication.oauth_succeeded',
            'authentication.sso_succeeded',
            'authentication.password_succeeded',
            'authentication.magic_auth_succeeded',
          ],
          limit: 5,
        });
    
        console.log(`Found ${result.data.length} events\n`);
    
        for (const event of result.data) {
          console.log('─'.repeat(60));
          console.log(`Event ID: ${event.id}`);
          console.log(`Type: ${event.event}`);
          console.log(`Created: ${event.createdAt}`);
    
          if (event.context) {
            console.log('Context:', JSON.stringify(event.context, null, 2));
          } else {
            console.log('Context: (not present)');
          }
          console.log();
        }
    
        // Summary
        const eventsWithContext = result.data.filter((e) => e.context);
        console.log('─'.repeat(60));
        console.log(
          `\nSummary: ${eventsWithContext.length}/${result.data.length} events have context field`,
        );
    
        if (eventsWithContext.length > 0) {
          console.log('\n✅ Context field is being deserialized correctly!');
        } else {
          console.log(
            '\n⚠️  No events with context found. This may be expected if no recent authentication events exist.',
          );
        }
      } catch (error) {
        console.error('Error fetching events:', error);
        process.exit(1);
      }
    }
    
    main();
    ```
    
    </details>
    
    Fixes #1415
    nicknisi authored Jan 9, 2026
    Configuration menu
    Copy the full SHA
    2a1c99d View commit details
    Browse the repository at this point in the history
  2. v7.82.0 (#1443)

    ## Description
    
    - #1442 
    
    ## Documentation
    
    Does this require changes to the WorkOS Docs? E.g. the [API
    Reference](https://workos.com/docs/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.
    nicknisi authored Jan 9, 2026
    Configuration menu
    Copy the full SHA
    24b8ea8 View commit details
    Browse the repository at this point in the history
Loading