Installation
First, install the Beam provider package:Prerequisites
Before using the Beam provider, you need to:- Sign up for a Beam account at https://beam.cloud
- Get your Beam Token and Workspace ID from the dashboard
- Set them as environment variables:
Configuration
VibeKit uses a builder pattern with method chaining for type safety and flexibility. Configure your Beam provider and VibeKit instance:Using the provider directly
Using configuration object
Configuration Options
ThecreateBeamProvider
function accepts these configuration options:
Required Options
token
(string): Your Beam authentication token from the dashboardworkspaceId
(string): Your Beam workspace ID
Optional Options
-
image
(string): Custom Docker image. If not provided, it will be auto-selected based on the agent type:claude
→superagentai/vibekit-claude:1.0
codex
→superagentai/vibekit-codex:1.0
opencode
→superagentai/vibekit-opencode:1.0
gemini
→superagentai/vibekit-gemini:1.1
grok
→superagentai/vibekit-grok-cli:1.0
- Default:
ubuntu:22.04
-
cpu
(number): Number of CPU cores to allocate (default: 2) -
memory
(number | string): Memory allocation, e.g., 1024 or “1Gi” (default: “1Gi”) -
keepWarmSeconds
(number): How long to keep the sandbox warm after inactivity (default: 300 seconds / 5 minutes)
ENV variables and secrets
Configure your Beam provider using environment variables:Unique Features
Automatic Image Selection
Beam automatically selects the appropriate pre-built Docker image based on your agent type, ensuring optimal compatibility and performance without manual configuration.Serverless Scalability
- On-demand resources - Sandboxes spin up automatically when needed
- Automatic scaling - Resources scale based on workload
- Pay-per-use - Only pay for actual compute time used
- No infrastructure management - Beam handles all server provisioning and maintenance
Performance Optimization
- Fast cold starts - Optimized container initialization
- Keep-warm configuration - Keep sandboxes warm between requests for faster response times
- Configurable resources - Adjust CPU and memory per workload
- Port exposure - Dynamically expose ports for web services
Advanced Usage
Custom Docker Image
Use your own Docker image with pre-installed dependencies:High-Performance Configuration
For compute-intensive workloads:Background Command Execution
Run long-running processes in the background:Exposing Multiple Ports
Expose multiple services running on different ports:System Requirements
- Node.js 18+ - Runtime environment
- Beam account - Active account with API credentials
- Internet connection - Required for cloud sandbox execution
Limitations
- Pause/Resume: Beam doesn’t directly support pause/resume operations. The sandbox remains active until terminated. Use
keepWarmSeconds
to manage idle timeouts and optimize costs. - Beta SDK: The Beam TypeScript SDK is currently in beta. Some features may change in future releases.
- Cold start time: Initial sandbox creation may take a few seconds. Use
keepWarmSeconds
to maintain warm sandboxes for faster subsequent executions.
Troubleshooting
Authentication errors:Cost Optimization Tips
-
Use keep-warm wisely: Set
keepWarmSeconds
based on your usage pattern- High frequency: 600+ seconds (10+ minutes)
- Low frequency: 300 seconds (5 minutes) or less
-
Right-size resources: Start with minimal resources and scale up as needed
-
Clean up promptly: Always call
kill()
when done to avoid unnecessary charges
Support
For issues related to:- Beam SDK: Visit Beam Documentation
- VibeKit Integration: Open an issue on GitHub
- Community Support: Join our Discord
Next Steps
- Explore GitHub integration for automated PR workflows
- Learn about streaming for real-time command output
- Check out session management for persistent workflows