autorecordlive
v1.0.0
Published
Official Node.js SDK for AutoRecordLive — cloud TikTok and Douyin live stream recording API
Maintainers
Readme
autorecordlive
Official Node.js SDK for AutoRecordLive — the cloud TikTok Live Recorder that automatically detects and records live streams, even when you're offline.
What is AutoRecordLive?
AutoRecordLive is a cloud-based TikTok Live Recorder. Add a TikTok or Douyin channel once, and AutoRecordLive monitors it around the clock — starting the recording the moment the creator goes live. No device needs to stay running. No screen recording. No missed streams.
This SDK lets you integrate TikTok live stream recording into your own applications, automation pipelines, and workflows using the AutoRecordLive API.
Installation
npm install autorecordlive
# or
yarn add autorecordlive
# or
pnpm add autorecordliveRequires Node.js 18 or later (uses the built-in fetch API).
Quick start
Get your API key from app.autorecordlive.com/settings/api.
import { AutoRecordLive } from 'autorecordlive';
const client = new AutoRecordLive({
apiKey: process.env.AUTORECORDLIVE_API_KEY!,
});
// Add a TikTok channel — recording starts automatically when the creator goes live
const channel = await client.addChannel({
platform: 'tiktok',
url: 'https://www.tiktok.com/@username/live',
});
console.log(`Monitoring ${channel.name} (${channel.status})`);API
new AutoRecordLive(options)
| Option | Type | Required | Description |
|--------|------|----------|-------------|
| apiKey | string | ✅ | Your AutoRecordLive API key |
| baseUrl | string | — | Override the API base URL (for testing) |
Channels
addChannel(options) → Promise<Channel>
Add a TikTok or Douyin channel for automatic recording. AutoRecordLive begins monitoring immediately.
const channel = await client.addChannel({
platform: 'tiktok',
url: 'https://www.tiktok.com/@username/live',
name: 'My Creator', // optional label
});listChannels() → Promise<Channel[]>
List all channels currently being monitored.
const channels = await client.listChannels();
channels.forEach(c => console.log(c.name, c.status));getChannel(id) → Promise<Channel>
Get a channel by ID.
removeChannel(id) → Promise<void>
Stop monitoring a channel. Existing recordings are not deleted.
Recordings
listRecordings(options?) → Promise<PaginatedResult<Recording>>
List recordings, with optional filters.
// All ready recordings for a specific channel
const { data, total } = await client.listRecordings({
channel_id: channel.id,
status: 'ready',
limit: 20,
});
data.forEach(r => {
console.log(`Recording from ${r.started_at} — ${r.duration}s`);
if (r.download_url) console.log('Download:', r.download_url);
});getRecording(id) → Promise<Recording>
Get a single recording. When status is 'ready', download_url contains a signed link valid for 24 hours.
const recording = await client.getRecording('rec_abc123');
if (recording.status === 'ready' && recording.download_url) {
// Signed URL — valid 24h
console.log('Download MP4:', recording.download_url);
}Types
interface Channel {
id: string;
platform: 'tiktok' | 'douyin';
url: string;
name: string;
status: 'monitoring' | 'recording' | 'paused';
created_at: string;
updated_at: string;
}
interface Recording {
id: string;
channel_id: string;
platform: 'tiktok' | 'douyin';
started_at: string;
ended_at: string | null;
duration: number | null; // seconds
status: 'processing' | 'ready' | 'failed';
download_url: string | null; // signed URL, valid 24h
size_bytes: number | null;
}Error handling
All API errors throw AutoRecordLiveError with .status (HTTP status code) and optional .code.
import { AutoRecordLive, AutoRecordLiveError } from 'autorecordlive';
try {
const channel = await client.addChannel({ platform: 'tiktok', url: '...' });
} catch (err) {
if (err instanceof AutoRecordLiveError) {
console.error(`API error ${err.status}: ${err.message}`);
}
}Example: webhook-triggered download
import { AutoRecordLive } from 'autorecordlive';
const client = new AutoRecordLive({ apiKey: process.env.AUTORECORDLIVE_API_KEY! });
// Called when AutoRecordLive sends a webhook for a finished recording
async function onRecordingReady(recordingId: string) {
const recording = await client.getRecording(recordingId);
if (recording.status === 'ready' && recording.download_url) {
console.log(`Recording ready: ${recording.download_url}`);
console.log(`Duration: ${recording.duration}s`);
console.log(`Size: ${((recording.size_bytes ?? 0) / 1e6).toFixed(1)} MB`);
}
}Links
- Product: autorecordlive.com
- TikTok Live Recorder guide: autorecordlive.com/tiktok-live-recorder
- Get API key: app.autorecordlive.com/settings/api
- Source & issues: github.com/autorecordlive/node
- Support: [email protected]
License
MIT © AutoRecordLive
