Skip to content

wesbos/rs-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Riverside API Client

run npm run example for an example.

Installation

npm install

Setup

Create a .env file:

RIVERSIDE_EMAIL=your@email.com
RIVERSIDE_PASSWORD=yourpassword

Quick Start

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);

API Methods

Authentication

  • login(email, password) - Authenticate with credentials
  • setTokens(tokens) - Restore a previous session
  • getTokens() - Get current tokens for persistence
  • getAuthStatus() - Check authentication state
  • logout() - Clear session

Projects

  • getProjects(studioSlug, options?) - List projects for a studio
  • getAllProjects(studioSlug) - Get all projects (handles pagination)

Takes

  • getTake(takeId) - Get a single take by ID
  • getRecentTakes(productionId) - Get recent takes across all projects
  • getProjectTakes(projectId, options?) - Get takes with full recording details

Assets

  • fetchAsset(urlOrPath) - Fetch asset with auth, returns Response
  • downloadAsset(urlOrPath) - Download asset, returns ArrayBuffer

Session Persistence

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();

Run Example

npm run example

About

private API for rs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published