@ai-sdk/svelte 2.0.0 removes useChat, useCompletion and useAssistant along with their helper types, and it requires svelte 5, where 1.1.24 accepted 3, 4 or 5. Any file that imports one of these names from @ai-sdk/svelte stops type-checking. Svelte 5 is a prerequisite for the replacements, so check your installed svelte first.
What changed
useChatis nowChat.useChat,UseChatHelpersandUseChatOptionsare no longer exported. TheChatclass is built withChatOptions, andmessages,input,data,statusanderrorare plain properties on the instance.append,reload,stop,handleSubmitandaddToolResultare methods.keepLastMessageOnErroris gone from the options, andisLoadingis replaced bystatus.useCompletionis nowCompletion.useCompletion,UseCompletionHelpersandUseCompletionOptionsare no longer exported.Completionis built withCompletionOptions. It exposescompletion,input,data,loadinganderror, withcomplete,stopandhandleSubmitas methods.isLoadingis nowloading.useAssistantis removed with no replacement.useAssistantandUseAssistantHelpersare gone, and neitherChatnorCompletiondrives the OpenAI Assistants API that it read.- Stores are gone. Nothing returned by the new classes is a Svelte store, so
$messages,$inputand similar reads in markup no longer work.
Before and after
The site you are most likely to meet is a component that destructures stores from useChat:
<script lang="ts"> import { useChat } from '@ai-sdk/svelte';
const { messages, input, handleSubmit } = useChat({ api: '/api/chat', keepLastMessageOnError: true });</script>
{#each $messages as message (message.id)} <p>{message.content}</p>{/each}<form on:submit={handleSubmit}><input bind:value={$input} /></form>The assisted patch constructs the chat once, drops keepLastMessageOnError, and reads properties off the instance without destructuring them:
<script lang="ts"> import { Chat } from '@ai-sdk/svelte';
const chat = new Chat({ api: '/api/chat' });</script>
{#each chat.messages as message (message.id)} <p>{message.content}</p>{/each}<form onsubmit={chat.handleSubmit}><input bind:value={chat.input} /></form>The patch edits the script only. Change the markup reads alongside it, as shown above. The useCompletion rewrite follows the same shape, with isLoading renamed to loading. No change in this release has a deterministic patch.
Migration guidance and its limits
Run emendant scan to list the files that import the removed names, then emendant fix. All three findings have assisted patches, so emendant fix writes one only when you name a model provider, on the command line or in your Emendant configuration. Each patch is checked with your typecheck and with the tests it affects. Nothing in this release is report only.
If your installed svelte is older than 5, the classes cannot be used and the patch does not apply. Upgrade svelte first, then run the fix again.
useAssistant is the exception to the other two. Moving off it means moving the route off the Assistants API onto one that Chat can read, which changes the server as well as the component. The patch does not attempt that rewrite, so replace the store by hand.
A clean scan covers imports of the removed names from @ai-sdk/svelte in .ts files and in the script of a .svelte file. Names imported from other packages, such as @ai-sdk/react, are not reported, and neither are store reads in markup. Review those reads yourself, and check any code that destructured values from the old result, because a destructured value from a class instance does not update.
What Emendant detects, fixes and verifies
3 changes in @ai-sdk/svelte 2.0.0. 0 automatic fixes, 3 fixes requiring a model provider you choose, 0 report only. Each patch states which checks passed. Understand patch evidence.
| Change | Severity | Detects | Fix | Verified by |
|---|---|---|---|---|
useChat was removed in favour of the Chat classai-sdk-svelte-npm-2.0.0-use-chat-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
useCompletion was removed in favour of the Completion classai-sdk-svelte-npm-2.0.0-use-completion-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
useAssistant was removedai-sdk-svelte-npm-2.0.0-use-assistant-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
emendant explain <change-id> prints any row's entry, guidance and sources at the terminal.
The error TS lines are what TypeScript 5.9.3 printed when code that compiled against @ai-sdk/svelte 1.1.24 was compiled against 2.0.0. A row without one is a change the compiler does not report, such as a deprecation or a change in behaviour.
Coverage
Requires emendant@0.3.0 or later. Run emendant feed update to get the latest coverage.
Coverage details
- Snapshot
2026-10-22.2, sequence 56, signed 22 October 2026- Feed entry
feed/npm/@ai-sdk/svelte/2.0.0.json
emendant feed status shows the snapshot your machine holds.
Primary sources
- package.jsonvercel/ai at @ai-sdk/svelte@2.0.0
- Changelogvercel/ai at @ai-sdk/svelte@2.0.0
- @ai-sdk/svelte@2.0.0npm registry, the published package
- @ai-sdk/svelte@1.1.24npm registry, the published package
- Sveltevercel/ai at @ai-sdk/svelte@2.0.0
Scan your repository
Find affected code without editing your files.
npx emendant scanThen npx emendant fix writes the patches the table says exist. The getting started guide covers the flags and the patch grades.
Related release pages
- Later @ai-sdk/svelte release: @ai-sdk/svelte 3.0.0: Chat API migration
Every @ai-sdk/svelte release page is listed on one page.