Skip to main content
The video group manages the full lifecycle of video: uploading source files, transcoding, captions, watermark profiles, and serving playback with short-lived signed tokens. It fits destination and product marketing video as well as gated content.
import { createVoyantCloudClient } from "@voyant-travel/cloud-sdk";

const client = createVoyantCloudClient({ apiKey: process.env.VOYANT_API_KEY! });

Upload

Create an upload to receive a one-time TUS upload endpoint, then upload the file bytes to that endpoint with a TUS client.
declare const file: File;

const ticket = await client.video.videos.createUpload({
  name: "intro",
  fileSize: file.size,
  maxDurationSeconds: 600,
  tags: ["marketing", "launch"],
});

// ticket.uploadUrl is a one-time TUS endpoint.
// Upload the bytes with a TUS client such as tus-js-client,
// using uploadUrl: ticket.uploadUrl.
You can also create a video from a URL with client.video.videos.createFromUrl(input).

Captions and watermarks

// List and upload captions for a video
const captions = await client.video.videos.captions.list(videoId);

// Manage watermark profiles
const watermarks = await client.video.watermarks.list();

Signed playback

Mint a short-lived signed token to play protected video. The token resolves to playable HLS and DASH URLs.
const signed = await client.video.videos.mintToken({ /* videoId, ... */ });

Scopes

MethodsScope
videos.list, videos.get, videos.mintToken, videos.captions.list, watermarks.listvideo:read
videos.createUpload, videos.createFromUrl, videos.update, videos.enableDownloadvideo:upload
videos.deletevideo:delete
videos.captions.upload, videos.captions.generate, videos.captions.deletevideo:captions:write
watermarks.create, watermarks.deletevideo:watermarks:write
Key types: VideoSummary, VideoUploadTicket, VideoCaptionSummary, VideoWatermarkProfileSummary, VideoSignedToken, CreateVideoUploadInput, CreateVideoFromUrlInput, MintVideoSignedTokenInput.