@ai-sdk/svelte migration guide
Choose an @ai-sdk/svelte migration path: hooks to classes in 2.0, then Chat methods, messages and transport options in 3.0.
An @ai-sdk/svelte upgrade can cross two different API changes. Version 2.0 replaces hooks with classes. Version 3.0 changes the Chat class again, including its methods, message shape and constructor options. Read both guides when your installed version is below 2.0 and your target is 3.0 or later.
Choose your migration path
- Move hooks to classes in 2.0: useChat and useCompletion give way to Chat and Completion. useAssistant is removed without a replacement. Review how the component creates and holds each instance.
- Update Chat usage for 3.0: append becomes sendMessage and reload becomes regenerate. Review message parts, removed data properties, transport options and the new addToolResult argument shape. The guide distinguishes the supported findings from migration work you must check yourself.
Check your upgrade
Check your installed version in the manifest and lockfile, then read the release pages your upgrade crosses. Run npx emendant scan to find supported changes in TypeScript and JavaScript source without editing your files. Use npx emendant fix --dry-run to preview deterministic patches where available. The preview does not install dependencies, run your checks or call a model. Assisted patches need a named model provider and a fix run without --dry-run. After updating dependencies, run your typecheck and tests and review the patch grades in the fix guide.
Coverage and limits
Possible fixes for these releases are assisted and require a named model provider. Template expressions are outside the scan, and managed input and handleSubmit changes are not among the 3.0 findings. Check the component markup and server route as well as the reported source files.
The linked release pages list covered findings, possible fixes and tagged sources. A clean scan does not prove that every migration step is complete. Read the supported projects guide for the scan's scope.
@ai-sdk/svelte release pages
- @ai-sdk/svelte 3.0.0: Chat API migration
@ai-sdk/svelte 3.0.0, released 31 July 2025. 11 breaking, 0 deprecations. - @ai-sdk/svelte 2.0.0: hooks move to classes
@ai-sdk/svelte 2.0.0, released 17 March 2025. 3 breaking, 0 deprecations.
Releases without a page here may still be in the feed. Run emendant feed status to see what your snapshot holds.