
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@addpipe/react-pipe-media-recorder
Advanced tools
A React custom hook that integrates the addpipe.com recording client
@addpipe/react-pipe-media-recorder provides a fully typed React hook for both TypeScript and JavaScript integrations that introduces the Pipe Platform into your React projects. This package allows video, audio, and screen + camera recording. It's ideal for applications that need to capture user-generated content such as video feedback, messages, resumes, or testimonials. The recorder is easy to set up and ensures cross-platform compatibility, working on both desktop and mobile devices.
With @addpipe/react-pipe-media-recorder, you can:
Note: You will need a free trial or paid account with Addpipe to use this package.
Install the package using npm:
npm install @addpipe/react-pipe-media-recorder
👉 Working Demo: You can find a working demo here. The source code for the demo is available in both JavaScript and TypeScript React. Find more about it here.
In this example, we insert a single Pipe recorder into the page and control it using the recorder's API (record() and stopVideo()).
import { useState } from "react";
import usePipeSDK from "@addpipe/react-pipe-media-recorder"; // Importing the Pipe recorder npm package
// Inserting a single Pipe recorder into the page
const SingleRecorder = () => {
// Storing the generated recorder inside of a state - optional
const [recorder, setRecorder] = useState(null);
const [canRecord, setCanRecord] = useState(false);
// Using the Pipe recorder custom hook
const { isLoaded } = usePipeSDK((PipeSDK) => {
// Check to make sure the code below is only executed on the initial load
if (isLoaded) return;
// Prepare the parameters needed to generate a new recorder
const pipeParams = { size: { width: 640, height: 390 }, qualityurl: "avq/360p.xml", accountHash: "YOUR_ACCOUNT_HASH", eid: "YOUR_ENV_CODE", mrt: 600, avrec: 1 };
// Inserting a new recorder into the page
PipeSDK.insert("custom-id", pipeParams, (pipeRecorder) => {
setRecorder(pipeRecorder); // Store the recorder instance for later use
pipeRecorder.onReadyToRecord = () => {
setCanRecord(true);
}
});
});
// Function to start a new recording using the recorder's API
const startRecording = () => {
if (!recorder || !canRecord) return;
recorder.record(); // Call to start recording
};
// Function to stop a recording using the recorder's API
const stopRecording = () => {
if (!recorder || !canRecord) return;
recorder.stopVideo(); // Call to stop recording
};
return (
<div>
{!isLoaded && <div>Loading the Pipe recorder</div>}
<div id="custom-id"></div> {/* Placeholder for where the new recorder should be inserted */}
{isLoaded && recorder && (
<>
{/* Buttons to control the recorder - Only display them after all prerequisites have loaded */}
<button onClick={startRecording}>Record</button>
<button onClick={stopRecording}>Stop</button>
</>
)}
</div>
);
};
export default SingleRecorder;
In this example, we insert a single Pipe recorder into the page and control it using the recorder's API (record() and stopVideo()). We load it from our EU client delivery servers (S1) and use a specific version of pipe.js and pipe.css.
import { useState } from "react";
import usePipeSDK from "@addpipe/react-pipe-media-recorder"; // Importing the Pipe recorder npm package
// Inserting a single Pipe recorder into the page
const SingleRecorder = () => {
// Storing the generated recorder inside of a state - optional
const [recorder, setRecorder] = useState(null);
const [canRecord, setCanRecord] = useState(false);
// Custom options
const options = {
useS1: true, // Load from our EU client delivery servers (S1)
buildSlug: "BUILD_SLUG" // Request a specific version of pipe.js and pipe.css
}
// Using the Pipe recorder custom hook with S1 and custom build slug
const { isLoaded } = usePipeSDK((PipeSDK) => {
// Check to make sure the code below is only executed on the initial load
if (isLoaded) return;
// Prepare the parameters needed to generate a new recorder
const pipeParams = { size: { width: 640, height: 390 }, qualityurl: "avq/360p.xml", accountHash: "YOUR_ACCOUNT_HASH", eid: "YOUR_ENV_CODE", mrt: 600, avrec: 1 };
// Inserting a new recorder into the page
PipeSDK.insert("custom-id", pipeParams, (pipeRecorder) => {
setRecorder(pipeRecorder); // Store the recorder instance for later use
pipeRecorder.onReadyToRecord = () => {
setCanRecord(true);
}
});
}, options);
// Function to start a new recording using the recorder's API
const startRecording = () => {
if (!recorder || !canRecord) return;
recorder.record(); // Call to start recording
};
// Function to stop a recording using the recorder's API
const stopRecording = () => {
if (!recorder || !canRecord) return;
recorder.stopVideo(); // Call to stop recording
};
return (
<div>
{!isLoaded && <div>Loading the Pipe recorder</div>}
<div id="custom-id"></div> {/* Placeholder for where the new recorder should be inserted */}
{isLoaded && recorder && (
<>
{/* Buttons to control the recorder - Only display them after all prerequisites have loaded */}
<button onClick={startRecording}>Record</button>
<button onClick={stopRecording}>Stop</button>
</>
)}
</div>
);
};
export default SingleRecorder;
This example demonstrates how to insert multiple Pipe recorders into the page.
import { useState } from "react";
import usePipeSDK from "@addpipe/react-pipe-media-recorder"; // Importing the Pipe recorder npm package
// Inserting multiple Pipe recorders into the page
const MultipleRecorders = () => {
// Storing the global PipeSDK into a state
const [pipeSdk, setPipeSdk] = useState(null);
// Custom IDs for the recorders
const CUSTOM_IDS = ["custom-id-1", "custom-id-2", "custom-id-3"];
// Using the Pipe recorder custom hook
const { isLoaded } = usePipeSDK((PipeSDK) => {
// Check to make sure the code below is only executed on the initial load
if (isLoaded) return;
// Prepare the parameters needed to generate new recorders
const pipeParams = { size: { width: 640, height: 390 }, qualityurl: "avq/360p.xml", accountHash: "YOUR_ACCOUNT_HASH", eid: "YOUR_ENV_CODE", mrt: 600, avrec: 1 };
// Inserting new recorders into the page
CUSTOM_IDS.forEach((id) => PipeSDK.insert(id, pipeParams, () => {}));
// Store PipeSDK into a state for controlling the recorders later
setPipeSdk(PipeSDK);
});
// Function to start a new recording using PipeSDK
const startRecording = (recorderId) => {
if (!pipeSdk) return;
pipeSdk.getRecorderById(recorderId).record(); // Call to start recording for a specific recorder
};
// Function to stop a recording using PipeSDK
const stopRecording = (recorderId) => {
if (!pipeSdk) return;
pipeSdk.getRecorderById(recorderId).stopVideo(); // Call to stop recording for a specific recorder
};
return (
<>
{CUSTOM_IDS.map((id, index) => (
<div key={index}>
<div id={id}></div> {/* Placeholder for where the new recorder should be inserted */}
{/* Buttons to control the recorder - Only display them after all prerequisites have loaded */}
{isLoaded && (
<>
<button onClick={() => startRecording(id)}>Record</button>
<button onClick={() => stopRecording(id)}>Stop</button>
</>
)}
</div>
))}
</>
);
};
export default MultipleRecorders;
To control the recorders, you can use the API control methods, such as:
record(): Starts a new recording.stopVideo(): Stops the recording.A full list of the recorder's API control methods can be found in the official Pipe API Documentation.
The pipeParams object is used to configure the Pipe recorder. Here’s an example of its structure:
const pipeParams = {
size: { width: 640, height: 390 },
qualityurl: "avq/360p.xml",
accountHash: "YOUR_ACCOUNT_HASH",
eid: "YOUR_ENV_CODE",
mrt: 600,
avrec: 1,
// Additional options available in the official documentation
};
For more detailed embed code options, refer to the Addpipe Embed Code Options.
All releases are available here
FAQs
A React custom hook that integrates the addpipe.com recording client
The npm package @addpipe/react-pipe-media-recorder receives a total of 3,227 weekly downloads. As such, @addpipe/react-pipe-media-recorder popularity was classified as popular.
We found that @addpipe/react-pipe-media-recorder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.