Overview
The Mocra JavaScript SDK wraps the Mocra REST API and handles authentication, serialization, and error handling for you. TypeScript typings are included. Package:@mocra/observe — requires Node.js 18+
Installation
Quick start
VideoObservabilityApi
The main client class. Instantiate it once with your API key and reuse it across requests.
Constructor parameters
scoreVideo()
Analyzes a video against Mocra’s built-in criteria and any custom criteria you provide.
Parameters
Returns: Promise<ScoreMap>
ExtraCriterion
Defines a custom quality criterion to include in the analysis.
Default criteria
The following built-in criteria are evaluated by default. Pass one or more of these strings toignoreCriteria to exclude them from the analysis.
Error handling
scoreVideo rejects with an error if the API returns a non-200 response or if a network failure occurs.

