@huddle01/server-sdk
Version:
The Huddle01 Server SDK allows you to perform protected admin actions on your server side, like generating peer access tokens and starting and stopping meeting recordings and livestreams.
110 lines (107 loc) • 3.08 kB
TypeScript
import { z } from 'zod';
declare const RecordingTypeSchema: z.ZodEnum<["recording", "livestream"]>;
type TRecordingType = z.infer<typeof RecordingTypeSchema>;
declare const apiKeyRecordingsSchema: z.ZodObject<{
sessionId: z.ZodOptional<z.ZodString>;
limit: z.ZodOptional<z.ZodNumber>;
cursor: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
sessionId?: string | undefined;
limit?: number | undefined;
cursor?: number | undefined;
}, {
sessionId?: string | undefined;
limit?: number | undefined;
cursor?: number | undefined;
}>;
type GetRecordingsInputSchema = z.infer<typeof apiKeyRecordingsSchema>;
type CustomStorageOptions = {
s3?: {
accessKey: string;
secret: string;
region: string;
bucket: string;
};
gcp?: {
bucket: string;
credentials: string;
};
azure?: {
accountKey: string;
accountName: string;
containerName: string;
};
};
type CustomWatermark = {
url?: string;
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
size?: {
width: number;
height: number;
};
};
type webOptions = {
audioOnly?: boolean;
videoOnly?: boolean;
separateAudio?: boolean;
};
declare class Recorder {
private readonly projectId;
private readonly apiKey;
private readonly infraClient;
private readonly url;
constructor(projectId: string, apiKey: string);
startRecording(data: {
roomId: string;
token: string;
customLayoutUrl?: string;
customStorage?: CustomStorageOptions;
layout?: "grid" | "spotlight";
watermark?: CustomWatermark;
pinToIpfs?: boolean;
/**
* @description
* - If audioOnly is true, video will not be recorded
* - If videoOnly is true, audio will not be recorded
* - If both are true, an error will be thrown
*/
options?: webOptions;
}): Promise<{
msg: string;
}>;
startLivestream(data: {
roomId: string;
token: string;
rtmpUrls: string[];
customLayoutUrl?: string;
customStorage?: CustomStorageOptions;
recordLivestream?: boolean;
}): Promise<{
msg: string;
}>;
stop(data: {
roomId: string;
}): Promise<{
msg: string;
type: TRecordingType;
}>;
getRecordingStatus(data: {
roomId: string;
}): Promise<{
status: "ongoing" | "stopped";
type?: "recording" | "livestream" | undefined;
startTime?: number | undefined;
}>;
getRecordings: (data?: GetRecordingsInputSchema) => Promise<{
data: {
recordings: {
id: string;
recordingUrl: string;
recordingSize: number;
}[];
nextCursor: number | null;
} | null;
error?: Error;
}>;
}
export { type CustomStorageOptions, type CustomWatermark, type GetRecordingsInputSchema, Recorder, RecordingTypeSchema, type webOptions };