A complete beginner's guide. No prior experience required.
A script that opens a browser, visits a website, takes a screenshot, and clicks a link. All in about 10 lines of code.
Vibium runs on Node.js. Check if you have it:
node --versionIf you see a version number (like v18.0.0 or higher), skip to Step 2.
# Install Homebrew (if you don't have it)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Node
brew install nodeDownload and run the installer from nodejs.org. Choose the LTS version.
# Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# Or use your distro's package managerVerify it worked:
node --version # Should show v18.0.0 or higher
npm --version # Should show 9.0.0 or highermkdir my-first-bot
cd my-first-bot
npm init -yThis creates a folder and a package.json file.
npm install vibiumThis downloads Vibium and Chrome for Testing. Might take a minute.
Create a file called hello.js:
# macOS/Linux
touch hello.js
# Windows (PowerShell)
New-Item hello.jsOpen hello.js in any text editor and paste this:
const fs = require('fs')
const { browserSync } = require('vibium')
// Launch a browser (you'll see it open!)
const vibe = browserSync.launch()
// Go to a website
vibe.go('https://example.com')
console.log('Loaded example.com')
// Take a screenshot
const png = vibe.screenshot()
fs.writeFileSync('screenshot.png', png)
console.log('Saved screenshot.png')
// Find and click the link
const link = vibe.find('a')
console.log('Found link:', link.text())
link.click()
console.log('Clicked!')
// Close the browser
vibe.quit()
console.log('Done!')node hello.jsYou should see:
- A Chrome window open
- example.com load
- The browser click "Learn more"
- The browser close
Check your folder - there's now a screenshot.png file!
| Line | What It Does |
|---|---|
browserSync.launch() |
Opens Chrome |
vibe.go(url) |
Navigates to a URL |
vibe.screenshot() |
Captures the page as PNG |
vibe.find(selector) |
Finds an element by CSS selector |
link.click() |
Clicks the element |
vibe.quit() |
Closes the browser |
Hide the browser (run headless):
const vibe = browserSync.launch({ headless: true })Use async/await (for more complex scripts):
const { browser } = require('vibium')
async function main() {
const vibe = await browser.launch()
await vibe.go('https://example.com')
// ...
await vibe.quit()
}
main()Use Python instead: See Getting Started (Python) for the Python version.
Let AI control the browser: See Getting Started with MCP for Claude Code and Gemini CLI setup.
Node.js isn't installed or isn't in your PATH. Reinstall from nodejs.org.
Run npm install vibium in your project folder.
Try running with headless mode disabled (it's disabled by default, but just in case):
const vibe = browserSync.launch({ headless: false })You might need to install dependencies for Chrome:
sudo apt-get install -y libgbm1 libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2You just automated a browser. The same techniques work for:
- Web scraping
- Testing websites
- Automating repetitive tasks
- Building AI agents that can browse the web
Questions? Open an issue.