Skip to main content

Choose Your SDK

The VideoBGRemover SDKs provide a complete solution for background removal and video composition. Choose the SDK that matches your development environment:

Installation

Requirements

# Requirements:
# - Node.js 16+
# - FFmpeg (required for video composition)
# - VideoBGRemover API key

npm install @videobgremover/sdk

Verify Installation

import { VideoBGRemoverClient, Video, Background, Composition } from '@videobgremover/sdk'

// Check if FFmpeg is available
import { MediaContext } from '@videobgremover/sdk'
const ctx = new MediaContext()
console.log('FFmpeg available:', ctx.checkWebmSupport())

FFmpeg Installation

The SDKs require FFmpeg for video composition operations. Here’s how to install it:
# Using Homebrew (recommended)
brew install ffmpeg

# Verify installation
ffmpeg -version
ffprobe -version

API Key Setup

Get your API key from the VideoBGRemover Dashboard:
1

Create Account

2

Purchase Credits

Buy credits for video processing
3

Generate API Key

Create an API key in the API Management dashboard

Environment Setup

# Set environment variable
export VIDEOBGREMOVER_API_KEY="vbr_your_api_key_here"

# Or use .env file
echo "VIDEOBGREMOVER_API_KEY=vbr_your_api_key_here" > .env

Usage in Code

// In your code
const client = new VideoBGRemoverClient(process.env.VIDEOBGREMOVER_API_KEY!)

Verify Everything Works

Test your complete setup with this simple example:
import { VideoBGRemoverClient } from '@videobgremover/sdk'

async function test() {
  const client = new VideoBGRemoverClient(process.env.VIDEOBGREMOVER_API_KEY!)
  
  // Check credits
  const credits = await client.credits()
  console.log(`✅ API connected. Credits: ${credits.remainingCredits}`)
  
  // Check FFmpeg
  const ctx = new MediaContext()
  const hasWebm = ctx.checkWebmSupport()
  console.log(`✅ FFmpeg ready. WebM support: ${hasWebm}`)
}

test()

What’s Next?