@transcodely/sdk 0.3.10 → 0.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,20 @@ All notable changes to the Transcodely JavaScript / TypeScript SDK will be docum
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Breaking changes are allowed on minor bumps until 1.0.0.
6
6
 
7
+ ## [0.3.12](https://github.com/transcodely/transcodely-js/compare/v0.3.11...v0.3.12) (2026-10-25)
8
+
9
+
10
+ ### Features
11
+
12
+ * auto_insights upload option (api 5.25.0) ([#80](https://github.com/transcodely/transcodely-js/issues/80)) ([fccd526](https://github.com/transcodely/transcodely-js/commit/fccd52644fb83d347be99621ed5de93f40612584))
13
+
14
+ ## [0.3.11](https://github.com/transcodely/transcodely-js/compare/v0.3.10...v0.3.11) (2026-10-25)
15
+
16
+
17
+ ### Features
18
+
19
+ * transcripts & insights surface (proto sync) ([#77](https://github.com/transcodely/transcodely-js/issues/77)) ([554a81f](https://github.com/transcodely/transcodely-js/commit/554a81f80d0360d81c7e5670c45b6c49ea57f2e1))
20
+
7
21
  ## [0.3.10](https://github.com/transcodely/transcodely-js/compare/v0.3.9...v0.3.10) (2026-09-22)
8
22
 
9
23
 
package/README.md CHANGED
@@ -64,6 +64,11 @@ comes back already `processing`. Follow it with `client.videos.watch(video.id)`
64
64
  until it reaches `ready` (or `error`, or `deleted`), or subscribe to the
65
65
  `video.ready` webhook.
66
66
 
67
+ Pass `autoCaptions: true` to generate captions inline with the transcode, and
68
+ add `autoInsights: true` to also run AI insights over those captions (requires
69
+ `autoCaptions`; EUR 0.02 per video + EUR 0.005 per source minute on top of
70
+ captions).
71
+
67
72
  **The app does not need managed hosting turned on first.** An app that has never
68
73
  hosted anything is provisioned by the create call itself — bucket, managed
69
74
  origin and CDN pull zone — which is why a first upload takes a few seconds
@@ -227,6 +232,56 @@ for (const fee of job.fees) {
227
232
  }
228
233
  ```
229
234
 
235
+ ## Transcripts and insights
236
+
237
+ Every `generate` track also writes the transcript as `json`, `txt` and `md`.
238
+ Ask for the opt-in insights pass (summary, key points, chapters, questions,
239
+ terms, highlights) on the same track:
240
+
241
+ ```ts
242
+ import { SubtitleOperation, TranscriptStyle, TranscriptFormat, InsightsStatus } from "@transcodely/sdk";
243
+
244
+ await client.jobs.create({
245
+ inputVideoId: "vid_a1b2c3d4e5f6g7",
246
+ outputs: [{
247
+ subtitleTracks: [{
248
+ operation: SubtitleOperation.GENERATE,
249
+ transcript: { style: TranscriptStyle.CLEAN }, // default; LITERAL keeps fillers
250
+ insights: { enabled: true, hint: "conference talk for developers" },
251
+ }],
252
+ }],
253
+ });
254
+
255
+ // On a hosted video each rendition carries a short-lived signedUrl, re-issued
256
+ // on every read, so fetch the video right before downloading.
257
+ const video = await client.videos.get("vid_a1b2c3d4e5f6g7");
258
+ const txt = video.textTracks
259
+ .flatMap((t) => t.transcriptRenditions)
260
+ .find((r) => r.format === TranscriptFormat.TXT);
261
+ if (txt?.signedUrl) {
262
+ const transcript = await (await fetch(txt.signedUrl)).text();
263
+ console.log(transcript);
264
+ }
265
+
266
+ for (const ins of video.insights) {
267
+ if (ins.status === InsightsStatus.READY) {
268
+ console.log(ins.summary, ins.keyPoints);
269
+ for (const ch of ins.chapters) console.log(ch.startSeconds, ch.title);
270
+ }
271
+ }
272
+
273
+ // Ready-to-paste JSON-LD, video-sitemap entry and HTML fragment for your own page.
274
+ const kit = await client.videos.getSeoMarkup({
275
+ videoId: "vid_a1b2c3d4e5f6g7",
276
+ watchUrl: "https://example.com/watch/42",
277
+ });
278
+ console.log(kit.jsonLd, kit.sitemapEntry, kit.htmlFragment);
279
+ ```
280
+
281
+ Jobs carry the same data on `job.subtitleResults[i].transcriptRenditions` and
282
+ `job.insights`. The `job.insights.ready` and `job.insights.failed` webhook events
283
+ tell you when an insights pass finishes.
284
+
230
285
  ## Authentication
231
286
 
232
287
  Pass your API key in the constructor:
@@ -240,7 +295,7 @@ const client = new Transcodely({ apiKey: process.env.TRANSCODELY_API_KEY! });
240
295
  ```ts
241
296
  client.jobs // create / get / list / cancel / confirm / watch
242
297
  client.uploads // putFile — the whole create / PUT / complete upload, for a path, Blob or stream
243
- client.videos // upload RPCs, multipart, createFromUrl, get / list / update / delete / watch / getStats / listTopVideos
298
+ client.videos // upload RPCs, multipart, createFromUrl, get / list / update / delete / watch / getStats / listTopVideos / getSeoMarkup
244
299
  client.presets // create / get / getBySlug / list / update / duplicate / archive
245
300
  client.origins // create / get / list / update / validate / archive
246
301
  client.ingestRules // create / get / list / update / delete / listEvents / test / replayEvent