Skip to content

Conversation

@erquhart
Copy link
Contributor

Description

Adds a conditional export for the convex runtime.

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.

@erquhart erquhart requested a review from a team as a code owner October 25, 2025 22:37
@erquhart erquhart requested a review from alisherry October 25, 2025 22:37
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.

Greptile Overview

Greptile Summary

Adds a conditional export for the Convex runtime, mapping it to the worker build (./lib/index.worker.js). This follows the same pattern as existing edge runtime exports (workerd and edge-light).

  • Adds convex export condition pointing to worker build
  • Enables WorkOS SDK usage in Convex edge runtime environment
  • Consistent with existing edge runtime support architecture

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Simple configuration change that adds a new conditional export following established patterns. No code logic changes, no security concerns, and consistent with existing edge runtime exports
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
package.json 5/5 Added convex conditional export mapping to worker build, consistent with other edge runtime exports

Sequence Diagram

sequenceDiagram
    participant App as Convex Application
    participant NPM as npm/Package Manager
    participant PkgJson as package.json
    participant Worker as index.worker.js
    
    App->>NPM: import @workos-inc/node
    NPM->>PkgJson: Check exports conditions
    PkgJson->>PkgJson: Match "convex" condition
    PkgJson->>Worker: Resolve to ./lib/index.worker.js
    Worker->>App: Return WorkOSWorker instance
    Note over Worker,App: Uses Fetch API & SubtleCrypto<br/>for edge runtime compatibility
Loading

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@nicknisi nicknisi merged commit c44174f into workos:main Oct 28, 2025
5 checks passed
@nholden nholden mentioned this pull request Oct 28, 2025
nholden added a commit that referenced this pull request Oct 28, 2025
Version bump that includes:

- #1372
- #1373
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