TypeScript SDK
@lirovo/sdk is the official TypeScript client for the Lirovo API. Construct it with an API key, then call typed resource methods on schemas, destinations, and jobs.
Install#
The SDK is the @lirovo/sdk package. It is not yet published to the public npm registry; it ships with the first SDK release. The snippets on these pages show the surface you will use, and once it is published the install is one command:
npm i @lirovo/sdkThe only named import you need is the Lirovo class. The package also re-exports the wire types (Job, Schema, JobResult, and the rest) and the LirovoApiError class for downstream typing.
Quickstart#
Construct the client, register a schema, submit a job against a source video, and wait for the typed result. This example mirrors the SDK README.
import { Lirovo } from "@lirovo/sdk";
const lirovo = new Lirovo({ apiKey: process.env.LIROVO_API_KEY! });
// 1. Register a JSON Schema describing the output you want.
const schema = await lirovo.schemas.create({
name: "product-mentions",
jsonSchema: {
type: "object",
properties: {
products: { type: "array", items: { type: "string" } },
},
required: ["products"],
},
});
// 2. Submit a job against a source video.
const job = await lirovo.jobs.create({
sourceUri: "https://youtube.com/watch?v=...",
schemaId: schema.id,
});
// 3. Poll until the job reaches a terminal state, then fetch the result.
const result = await lirovo.jobs.waitForResult(job.id);
console.log(result);Reference#
The public surface is intentionally small: one Lirovo class with three resource sub-clients. Each page below documents one part of that surface.
Constructor config, the apiKey requirement, baseUrl, and the three resource sub-clients.
schemas.create, schemas.list, and schemas.get for registering and reading output schemas.
destinations.create and destinations.list for where succeeded results are pushed.
jobs.create, list, get, getResult, and waitForResult with exponential-backoff polling.
The LirovoApiError shape and how its codes mirror the REST error model.