AI SDK 6 support

Full compatibility with Vercel AI SDK 6 alongside existing 4 and 5 support.

Eric Allam

Eric Allam

CTO, Trigger.dev

Image for AI SDK 6 support

We've added support for Vercel AI SDK 6, expanding compatibility across major versions of the AI SDK.

What's New

The Trigger.dev SDK now supports AI SDK 6 alongside the existing support for 4 and 5. This update includes:

  • Expanded peer dependency support: The SDK now accepts ai@^4.2.0 || ^5.0.0 || ^6.0.0
  • Async validation handling: Updated internal code to properly handle the async validation pattern introduced in AI SDK 6's Schema type

Migration

If you're already using AI SDK 4 or 5, no changes are required. If you want to upgrade to AI SDK 6, simply update your dependency:


npm install ai@^6.0.0
# or
pnpm add ai@^6.0.0

Your existing Trigger.dev jobs that use AI SDK tools and schemas will continue to work seamlessly.

Technical Details

The main change involves handling the asynchronous nature of schema validation in AI SDK v6. The internal convertAISchemaToTaskSchema function now properly awaits validation results, ensuring compatibility with the new async validation pattern while maintaining backward compatibility with earlier versions.

Ready to start building?

Build and deploy your first task in 3 minutes.

Get started now