SDK for the v0 Platform API
https://github.com/vercel/v0-sdk.git
โ ๏ธ Developer Preview: This SDK is currently in beta and is subject to change. Use in production at your own risk.
A monorepo containing SDKs for interacting with the v0 Platform API to create and manage AI-powered chat conversations, projects, integrations, and more.
v0-sdk - TypeScript SDK for the v0 Platform API@v0-sdk/react - React components for rendering v0 Platform API content@v0-sdk/ai-tools - AI SDK tools for the v0 Platform APIcreate-v0-sdk-app - Create v0 SDK-powered apps with one commandv0-clone (Demo) - Full-featured v0 clone with authentication, database, and AI Elementssimple-v0 (Demo) - The simplest way to use v0. Just prompt and see your app generated instantlyclassic-v0 - Classic v0 interface clone with clean, minimalist designv0-sdk-react-example - Next.js example demonstrating @v0-sdk/react usage with multiple UI themesai-tools-example - Demonstrates @v0-sdk/ai-tools integration with AI SDK for advanced agent patternsThe fastest way to get started is with create-v0-sdk-app:
pnpm create v0-sdk-app@latest my-v0-app
# or
npx create-v0-sdk-app@latest my-v0-app
cd my-v0-app
This will create a new project with everything set up and ready to go.
pnpm add v0-sdk
# or
npm install v0-sdk
# or
yarn add v0-sdk
Get your API key from v0.dev/chat/settings/keys.
Set V0_API_KEY environment variable.
import { v0 } from 'v0-sdk'
// Create a new chat
const chat = await v0.chats.create({
message: 'Create a responsive navbar with Tailwind CSS',
system: 'You are an expert React developer',
})
console.log(`Chat created: ${chat.webUrl}`)
This monorepo uses Turborepo for build orchestration and pnpm for package management.
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests for all packages
pnpm test
# Type check all packages
pnpm type-check
# Format code
pnpm format
# Run commands in specific package
pnpm --filter v0-sdk build
pnpm --filter v0-sdk test
pnpm --filter v0-sdk generate
# Run commands in all packages
pnpm build
pnpm test
packages/package.json with the appropriate @v0-sdk/ scopetsconfig.json paths if neededturbo.jsonpnpm build - Build all packagespnpm test - Run tests for all packages (CI mode)pnpm test:watch - Run tests in watch modepnpm type-check - Type check all packagespnpm lint - Lint all packagespnpm format - Format code across all packagespnpm sdk:generate - Generate SDK from OpenAPI specThe project includes automated code quality checks:
This project uses Changesets for automated version management and publishing. See CONTRIBUTING.md for detailed release guidelines.
pnpm changeset - Create a new changeset (describes changes for release)The project includes GitHub Actions workflows:
ci.yml): Runs on every push and PR to mainrelease.yml): Automated releasesverify-changesets.yml):generate-sdk.yml):Apache 2.0