Created
September 23, 2025 21:47
-
-
Save vitorsouzaalmeida/49154af16caa1ef6d10821381e9c6110 to your computer and use it in GitHub Desktop.
Delete all your V0 chats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createClient } from 'v0-sdk'; | |
| const V0_API_KEY = ''; | |
| const v0 = createClient({ apiKey: V0_API_KEY }); | |
| const deleteAllV0Chats = async () => { | |
| console.log('Fetching all your V0 chats...'); | |
| try { | |
| const chatsResponse = await v0.chats.find(); | |
| const chats = chatsResponse.data || []; | |
| if (chats.length === 0) { | |
| console.log('No chats found in V0'); | |
| return; | |
| } | |
| console.log(`Found ${chats.length} chats\n`); | |
| let successCount = 0; | |
| let failCount = 0; | |
| for (const chat of chats) { | |
| console.log(`Processing: ${chat.name || 'Unnamed chat'} (ID: ${chat.id})`); | |
| console.log(` Created: ${new Date(chat.createdAt).toLocaleString()}`); | |
| if (chat.webUrl) { | |
| console.log(`URL: ${chat.webUrl}`); | |
| } | |
| try { | |
| await v0.chats.delete({ chatId: chat.id }); | |
| console.log('Successfully deleted'); | |
| successCount++; | |
| } catch (error) { | |
| console.error(`Failed to delete: ${error}`); | |
| failCount++; | |
| } | |
| console.log(); | |
| } | |
| console.log(`${'='.repeat(50)}`); | |
| console.log('Summary:'); | |
| console.log(`Successfully deleted: ${successCount}`); | |
| console.log(`Failed: ${failCount}`); | |
| console.log(`Total processed: ${chats.length}`); | |
| } catch (error) { | |
| console.error(`error: ${error}`); | |
| } | |
| }; | |
| const main = async () => { | |
| console.log(`This script will DELETE all your V0 chats`); | |
| await deleteAllV0Chats(); | |
| }; | |
| main().catch((error) => { | |
| console.error(`Unhandled error: ${error}`); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment