Overview

VibeKit provides a fluent interface for configuration. You can chain methods to configure the agent, sandbox provider, GitHub integration, and other options.

Basic configuration

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)
  .withGithub({
    token: process.env.GITHUB_TOKEN\!,
    repository: "your-org/your-repo",
  });

Configuration reference

Agent Configuration

Use the withAgent() method to configure which AI model to use.
.withAgent({
  type: "claude",
  provider: "anthropic",
  apiKey: "your-api-key",
  model: "claude-sonnet-4-20250514",
})

Agent Configuration Options

PropertyTypeRequiredDescription
typeAgentTypeYesThe type of AI agent to use
providerModelProviderYesThe AI provider service
apiKeystringYesAPI key for the chosen agent provider
modelstringYesSpecific model to use
Available agent types:
  • "claude" - Anthropic Claude agent
  • "codex" - OpenAI Codex agent
  • "opencode" - Opencode agent
  • "gemini" - Google Gemini agent
Available providers:
  • "anthropic" - Anthropic
  • "openai" - OpenAI
  • "openrouter" - OpenRouter
  • "azure" - Azure
  • "gemini" - Google Gemini
  • "ollama" - Ollama
  • "mistral" - Mistral AI
  • "deepseek" - DeepSeek
  • "xai" - xAI
  • "groq" - Groq

Sandbox Configuration

Use the withSandbox() method to configure the sandbox environment where code execution happens. You’ll need to install and import the specific provider package.

E2B Configuration

import { createE2BProvider } from "@vibe-kit/e2b";

const e2bProvider = createE2BProvider({
  apiKey: "e2b_****",
  templateId: "custom-template-id" // optional
});

.withSandbox(e2bProvider)

Northflank Configuration

import { createNorthflankProvider } from "@vibe-kit/northflank";

const northflankProvider = createNorthflankProvider({
  apiKey: "nf_****",
  image: "your-custom-image", // optional
  projectId: "your-project-id", // optional
  billingPlan: "nf-compute-200", // optional
  persistentVolumeStorage: 10240 // optional
});

.withSandbox(northflankProvider)

Daytona Configuration

import { createDaytonaProvider } from "@vibe-kit/daytona";

const daytonaProvider = createDaytonaProvider({
  apiKey: "daytona_****",
  image: "my-codex-image", // optional
  serverUrl: "https://app.daytona.io/api" // optional
});

.withSandbox(daytonaProvider)

Cloudflare Configuration

import { createCloudflareProvider } from "@vibe-kit/cloudflare";

// Must be used within a Cloudflare Worker
const cloudflareProvider = createCloudflareProvider({
  env: env, // Worker env object with Sandbox binding
  hostname: "your-worker.domain.workers.dev"
});

.withSandbox(cloudflareProvider)
For detailed configuration options for each provider, see the Supported Sandboxes section.

GitHub Integration

Use the withGithub() method to configure repository integration for pull request creation and code management.
.withGithub({
  token: "ghp_****",
  repository: "superagent-ai/vibekit"
})
PropertyTypeRequiredDescription
tokenstringYesGitHub personal access token with repository permissions
repositorystringYesRepository in the format “owner/repo-name”

Session Management (Optional)

Use the withSession() method to specify a sandbox session to reuse.
.withSession("existing-sandbox-id")
PropertyTypeRequiredDescription
sandboxIdstringYesExisting sandbox ID to reuse

Working Directory

Use the withWorkingDirectory() method to specify the directory where the agent should execute commands and work with files.
.withWorkingDirectory("/path/to/your/project")
PropertyTypeRequiredDefaultDescription
pathstringYes-The directory path where the agent will execute commands and access files

Secrets Management

Use the withSecrets() method to provide environment variables and secrets to the sandbox.
.withSecrets({
  "DATABASE_URL": "postgresql://...",
  "API_KEY": "secret-key",
  "NODE_ENV": "production"
})
PropertyTypeRequiredDescription
secretsRecord<string, string>YesKey-value pairs of environment variables to set in the sandbox

Complete Example

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)
  .withGithub({
    token: process.env.GITHUB_TOKEN\!,
    repository: "your-org/your-repo",
  })
  .withWorkingDirectory("/app")
  .withSecrets({
    "DATABASE_URL": process.env.DATABASE_URL\!,
    "API_KEY": process.env.API_KEY\!,
  });

// Use the configured VibeKit instance
const result = await vibeKit.generateCode({
  prompt: "Create a web server",
  mode: "ask"
});
EOF < /dev/null