Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@zac-workos
Copy link
Contributor

Exporting authkit-js objects to prevent the need to install authkit-js explicitly

@greptile-apps
Copy link

greptile-apps bot commented Dec 12, 2025

Greptile Overview

Greptile Summary

Re-exported commonly used types (User, AuthenticationResponse, JWTPayload, OnRefreshResponse) and error classes (AuthKitError, LoginRequiredError) from @workos-inc/authkit-js to provide a better developer experience by allowing consumers to import everything from a single package.

  • Added re-exports of two error classes that are already used internally in src/provider.tsx:138
  • Added re-exports of four TypeScript types that consumers may need when working with authentication responses and user data
  • Improves DX by eliminating the need to install and import from @workos-inc/authkit-js directly

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The changes only add re-exports of existing types and error classes from a dependency, with no logic changes or new functionality. The re-exported items are already used internally in the codebase, confirming they're valid exports.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
src/index.ts 5/5 Re-exported error classes (AuthKitError, LoginRequiredError) and type definitions (User, AuthenticationResponse, JWTPayload, OnRefreshResponse) from @workos-inc/authkit-js to simplify consumer imports

Sequence Diagram

sequenceDiagram
    participant Consumer as Consumer App
    participant AuthKitReact as @workos-inc/authkit-react
    participant AuthKitJS as @workos-inc/authkit-js
    
    Note over Consumer,AuthKitJS: Before this PR
    Consumer->>AuthKitReact: import { useAuth, AuthKitProvider }
    Consumer->>AuthKitJS: import { User, AuthKitError }
    Note over Consumer: Needs two package imports
    
    Note over Consumer,AuthKitJS: After this PR
    Consumer->>AuthKitReact: import { useAuth, User, AuthKitError }
    AuthKitReact->>AuthKitJS: Re-exports types and errors
    Note over Consumer: Single package import
Loading

Copy link

@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.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@zac-workos zac-workos requested a review from nicknisi December 12, 2025 17:37
Copy link
Member

@nicknisi nicknisi left a comment

Choose a reason for hiding this comment

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

Thanks!

@zac-workos zac-workos merged commit 726ec0c into main Dec 12, 2025
4 checks passed
@zac-workos zac-workos deleted the export-errors-types branch December 12, 2025 17:49
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.

4 participants