Skip to content

feat(ai-sdk): add AI SDK v6 / @ai-sdk/provider v3 peer dependency support#340

Open
matingathani wants to merge 1 commit intostripe:mainfrom
matingathani:feat/ai-sdk-v6-peer-deps-296
Open

feat(ai-sdk): add AI SDK v6 / @ai-sdk/provider v3 peer dependency support#340
matingathani wants to merge 1 commit intostripe:mainfrom
matingathani:feat/ai-sdk-v6-peer-deps-296

Conversation

@matingathani
Copy link
Copy Markdown
Contributor

Problem

Fixes #296

Users running ai@6.x (e.g. 6.0.84, 6.0.101) cannot install @stripe/ai-sdk cleanly because the package only declares peer dependency compatibility up to ai@^5.0.0, and provider packages (@ai-sdk/anthropic, @ai-sdk/google, @ai-sdk/openai) only up to ^2.x:

npm warn peer dep missing: ai@^3.4.7 || ^4.0.0 || ^5.0.0  ← doesn't cover v6

This forces users into unsafe casts or manual --legacy-peer-deps overrides to adopt the package.

Root Cause

The peerDependencies ranges in llm/ai-sdk/package.json were not updated when v6 / provider v3 support was added to the implementation.

What Was Already Working

The implementation code already fully supports @ai-sdk/provider@^3:

  • stripe-language-model-v3.ts implements LanguageModelV3
  • wrapperV3.ts wraps LanguageModelV3 models
  • stripe-provider.ts exports createStripeV3() / stripeV3 using ProviderV3
  • package.json already has "@ai-sdk/provider": "^3.0.0" as a dependency

The only gap was the peer dependency metadata advertised to npm.

Fix

Updated peerDependencies in llm/ai-sdk/package.json:

Package Before After
ai ^3.4.7 || ^4.0.0 || ^5.0.0 ^3.4.7 || ^4.0.0 || ^5.0.0 || ^6.0.0
@ai-sdk/anthropic ^2.0.41 ^2.0.41 || ^3.0.0
@ai-sdk/google ^2.0.27 ^2.0.27 || ^3.0.0
@ai-sdk/openai ^2.0.59 ^2.0.59 || ^3.0.0

No implementation code changes required.

Testing

  • Build and tests pass for all existing configurations.
  • Users on ai@6.x can now install without peer dependency warnings or --legacy-peer-deps.

…tripe#296)

Users on ai@6.x receive a peer dependency conflict when installing
@stripe/ai-sdk because the package only declared compatibility up to
ai@^5.0.0 and provider packages up to v2.

The implementation code already targets @ai-sdk/provider@^3
(LanguageModelV3, StripeLanguageModelV3, AISDKWrapperV3) so the only
change needed is updating the peerDependencies ranges in package.json:

  ai:                "^3.4.7 || ^4.0.0 || ^5.0.0 || ^6.0.0"
  @ai-sdk/anthropic: "^2.0.41 || ^3.0.0"
  @ai-sdk/google:    "^2.0.27 || ^3.0.0"
  @ai-sdk/openai:    "^2.0.59 || ^3.0.0"

Fixes stripe#296
Copilot AI review requested due to automatic review settings March 29, 2026 22:57
@cla-assistant
Copy link
Copy Markdown

cla-assistant bot commented Mar 29, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates @stripe/ai-sdk’s npm peer dependency ranges to explicitly declare compatibility with Vercel AI SDK ai@6 and AI SDK provider packages @ai-sdk/*@3, aligning the published metadata with already-existing implementation support.

Changes:

  • Expand ai peer dependency range to include ^6.0.0.
  • Expand @ai-sdk/anthropic, @ai-sdk/google, and @ai-sdk/openai peer dependency ranges to include ^3.0.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for AI SDK v6

2 participants