Skip to content

fix: export CookieSession from package root#1504

Merged
ajay-k merged 1 commit intomainfrom
fix/export-cookie-session-type
Feb 27, 2026
Merged

fix: export CookieSession from package root#1504
ajay-k merged 1 commit intomainfrom
fix/export-cookie-session-type

Conversation

@ajay-k
Copy link
Contributor

@ajay-k ajay-k commented Feb 27, 2026

CookieSession is the return type of loadSealedSession() and is correctly declared in lib/user-management/session.d.ts, but was never re-exported from the root barrel (src/index.ts). This meant TypeScript users couldn't import the type by name from @workos-inc/node.

Description

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.

CookieSession is the return type of loadSealedSession() and is correctly
declared in lib/user-management/session.d.ts, but was never re-exported
from the root barrel (src/index.ts). This meant TypeScript users couldn't
import the type by name from @workos-inc/node.

Fixes: https://workos.zendesk.com/agent/tickets/144656

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ajay-k ajay-k requested a review from a team as a code owner February 27, 2026 00:18
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

This PR fixes a TypeScript export issue by adding CookieSession to the package root exports. The CookieSession class is the return type of workos.userManagement.loadSealedSession() but was previously only importable from the internal module path, not from @workos-inc/node directly.

  • Added export { CookieSession } from './user-management/session' to src/index.ts
  • Follows the existing export pattern in the barrel file
  • No runtime changes, TypeScript-only improvement

Confidence Score: 5/5

  • This PR is completely safe to merge - it only adds a missing type export
  • Score reflects that this is a minimal, low-risk change that only affects TypeScript type exports without any runtime behavior changes. The export follows existing patterns and properly exposes a type that should have been exported originally.
  • No files require special attention

Important Files Changed

Filename Overview
src/index.ts adds export for CookieSession class to make it available for TypeScript users importing from package root

Last reviewed commit: 21a4059

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.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ajay-k ajay-k merged commit 29048e9 into main Feb 27, 2026
9 checks passed
@ajay-k ajay-k deleted the fix/export-cookie-session-type branch February 27, 2026 17:12
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