Add Video Recording to React in 5 Minutes
A step-by-step tutorial on integrating browser-based video recording into your React app using the VIDTREO SDK.
Christian Segovia March 1, 2026 5 min read
TL;DR
- Install
@vidtreo/recorder-react - Add
<VidtreoRecorder />component - That’s it. Your users can record video.
Step 1: Install the SDK
npm install @vidtreo/recorder-react
Step 2: Get Your API Key
- Sign up at app.vidtreo.com
- Create an environment
- Copy your API key
Step 3: Add the Recorder Component
import { VidtreoRecorder } from '@vidtreo/recorder-react'
function App() {
return (
<VidtreoRecorder
apiKey="your-api-key"
onRecordingComplete={(video) => {
console.log('Video recorded:', video.url)
}}
/>
)
}
That’s the minimal integration. The component handles:
- Camera/microphone permission requests
- Recording controls (start, stop, pause)
- Browser-native MP4 encoding
- Upload to VIDTREO’s edge storage
- Error handling and retry logic
Step 4: Customize (Optional)
<VidtreoRecorder
apiKey="your-api-key"
resolution="hd"
maxDuration={120}
locale="en"
onRecordingComplete={(video) => {
// Handle completed recording
}}
onError={(error) => {
// Handle errors
}}
/>
Using the Hook for Custom UI
Want full control over the UI? Use the useMobileWebRecorder hook:
import { useMobileWebRecorder } from '@vidtreo/recorder-react'
function CustomRecorder() {
const {
startRecording,
stopRecording,
isRecording,
videoUrl,
} = useMobileWebRecorder({ apiKey: 'your-api-key' })
return (
<div>
{!isRecording ? (
<button onClick={startRecording}>Record</button>
) : (
<button onClick={stopRecording}>Stop</button>
)}
{videoUrl && <video src={videoUrl} controls />}
</div>
)
}
What Happens Under the Hood
- Browser captures video via MediaStream API
- Our engine produces optimized MP4 in real-time
- Compact file uploads to VIDTREO’s global edge storage
- AI transcription runs automatically
- Webhook fires to notify your backend
All of this happens with zero server-side processing on your end.
Pricing
- Free tier: $1 credit (~100 HD minutes)
- HD recording: $0.01/minute
- No monthly fee, no credit card required to start
Next Steps
Related Posts
AI Transcription & Summaries: Why Your Video Platform Needs Them Built In
AI transcription services cost $0.002-0.036/min and require complex integrations. Learn how VIDTREO bundles transcription and AI summaries into every recording at no extra cost.
AI Transcription: Every Video Your App Records Becomes Analyzable Data
VIDTREO AI now transcribes every recording automatically — word-level timestamps, three formats, any language. Here's what your platform can do with video once it's text, and the signed-webhook infrastructure that delivers it.