fix: move @workos-inc/node to peerDependencies#32
Conversation
The SDK was listed as a regular dependency, which caused npm to install a separate copy nested inside authkit-session. Consumers using v9 of the SDK ended up with two copies (v8 bundled here, v9 at root), leading to type mismatches and requiring resolutions/overrides as a workaround. Moving to peerDependencies with range ^8.0.0 || ^9.0.0 ensures a single copy at runtime controlled by the consumer.
Greptile SummaryThis PR fixes a dual-copy SDK problem by promoting
Confidence Score: 5/5Safe to merge — the change correctly externalises the SDK as a peer dependency and resolves the dual-copy type-mismatch issue for v9 consumers. The change is narrowly scoped to dependency classification: removing a direct dep, adding a peer dep range, and bumping the dev dep. No application logic is touched. The only notable detail is that the package's engines.node still says >=20.0.0 while @workos-inc/node@9.x requires >=22.11.0, which could surprise Node 20 consumers who adopt v9 as their peer — but this is a documentation concern, not a functional regression. No files require special attention; both changed files are straightforward dependency manifest updates. Important Files Changed
|
Summary
@workos-inc/nodefromdependenciestopeerDependencieswith range^8.0.0 || ^9.0.0@workos-inc/node@^9.2.0todevDependenciesfor development/testingContext
Users on
@workos-inc/node@9.xare forced to use package managerresolutionsto avoid version conflicts.The SDK was a regular dependency pinned to
^8.0.0, causing npm to install a separate nested copy alongside the consumer's v9. Since authkit-session re-exports types from the SDK (User,Impersonator,WorkOS, etc.), this results in type mismatches across the package boundary.As a peer dependency, the consumer controls the SDK version and only one copy exists at runtime.
What's NOT affected
authkit-sessiononly usesuserManagementmethods (getJwksUrl,getAuthorizationUrl,getLogoutUrl,authenticateWithRefreshToken,authenticateWithCode) — none of which changed in v9. Build and tests pass against v9.2.0.Test plan
pnpm run buildpassespnpm test— 243/243 tests passauthkit-tanstack-startbuild + 217 tests pass with linked authkit-session