SDK

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:

bash
npm i @lirovo/sdk
Pre-release
The package is not on the public npm registry yet. Until the first release lands, the SDK is available through Lirovo onboarding.

The 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.

ts
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.