Follow these steps to install and run Vibekit:

Basic setup

Step 1: Install VibeKit Typescript SDK:
npm i @vibe-kit/sdk
Step 2: Configure your VibeKit client:
import { VibeKit } from "@vibe-kit/sdk";
import { createE2BProvider } from "@vibe-kit/e2b";

const e2bProvider = createE2BProvider({
  apiKey: process.env.E2B_API_KEY!,
  templateId: "vibekit-claude",
});

const vibeKit = new VibeKit()
  .withAgent({
    type: "claude",
    provider: "anthropic",
    apiKey: process.env.ANTHROPIC_API_KEY!,
    model: "claude-sonnet-4-20250514",
  })
  .withSandbox(e2bProvider);

Step 3: Add event listeners and generate code:
// Add event listeners
vibeKit.on("update", (update) => {
  console.log("Update:", update);
});

vibeKit.on("error", (error) => {
  console.error("Error:", error);
});

// Generate code
const result = await vibeKit.generateCode({
  prompt: "Create a simple web app that displays a list of users",
  mode: "code",
});

// Get host URL (optional)
const host = await vibeKit.getHost(3000);

// Clean up when done
await vibeKit.kill();

console.log("Result:", result);
console.log("Host:", host);