run npm run example for an example.
npm installCreate a .env file:
RIVERSIDE_EMAIL=your@email.com
RIVERSIDE_PASSWORD=yourpassword
import { getClient } from "./client.ts";
const client = await getClient();
// Get projects for a studio
const { projects } = await client.getProjects("my-studio");
// Get takes for a project
const { takes } = await client.getProjectTakes(projects[0]._id);
// Download a recording
const recording = takes[0].recordings[0];
const video = recording.files.find((f) => f.type === "video");
const buffer = await client.downloadAsset(video.downloadUrl);login(email, password)- Authenticate with credentialssetTokens(tokens)- Restore a previous sessiongetTokens()- Get current tokens for persistencegetAuthStatus()- Check authentication statelogout()- Clear session
getProjects(studioSlug, options?)- List projects for a studiogetAllProjects(studioSlug)- Get all projects (handles pagination)
getTake(takeId)- Get a single take by IDgetRecentTakes(productionId)- Get recent takes across all projectsgetProjectTakes(projectId, options?)- Get takes with full recording details
fetchAsset(urlOrPath)- Fetch asset with auth, returns ResponsedownloadAsset(urlOrPath)- Download asset, returns ArrayBuffer
The client.ts helper automatically saves/restores tokens to .riverside-tokens.json.
import { getClient } from "./client.ts";
// First run: logs in and saves tokens
// Subsequent runs: restores session from disk
const client = await getClient();npm run example