@transcodely/sdk 0.3.10 → 0.3.11
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 +7 -0
- package/README.md +51 -1
- package/dist/index.cjs +975 -94
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +666 -29
- package/dist/index.d.ts +666 -29
- package/dist/index.mjs +973 -95
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@ 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.11](https://github.com/transcodely/transcodely-js/compare/v0.3.10...v0.3.11) (2026-10-25)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* transcripts & insights surface (proto sync) ([#77](https://github.com/transcodely/transcodely-js/issues/77)) ([554a81f](https://github.com/transcodely/transcodely-js/commit/554a81f80d0360d81c7e5670c45b6c49ea57f2e1))
|
|
13
|
+
|
|
7
14
|
## [0.3.10](https://github.com/transcodely/transcodely-js/compare/v0.3.9...v0.3.10) (2026-09-22)
|
|
8
15
|
|
|
9
16
|
|
package/README.md
CHANGED
|
@@ -227,6 +227,56 @@ for (const fee of job.fees) {
|
|
|
227
227
|
}
|
|
228
228
|
```
|
|
229
229
|
|
|
230
|
+
## Transcripts and insights
|
|
231
|
+
|
|
232
|
+
Every `generate` track also writes the transcript as `json`, `txt` and `md`.
|
|
233
|
+
Ask for the opt-in insights pass (summary, key points, chapters, questions,
|
|
234
|
+
terms, highlights) on the same track:
|
|
235
|
+
|
|
236
|
+
```ts
|
|
237
|
+
import { SubtitleOperation, TranscriptStyle, TranscriptFormat, InsightsStatus } from "@transcodely/sdk";
|
|
238
|
+
|
|
239
|
+
await client.jobs.create({
|
|
240
|
+
inputVideoId: "vid_a1b2c3d4e5f6g7",
|
|
241
|
+
outputs: [{
|
|
242
|
+
subtitleTracks: [{
|
|
243
|
+
operation: SubtitleOperation.GENERATE,
|
|
244
|
+
transcript: { style: TranscriptStyle.CLEAN }, // default; LITERAL keeps fillers
|
|
245
|
+
insights: { enabled: true, hint: "conference talk for developers" },
|
|
246
|
+
}],
|
|
247
|
+
}],
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
// On a hosted video each rendition carries a short-lived signedUrl, re-issued
|
|
251
|
+
// on every read, so fetch the video right before downloading.
|
|
252
|
+
const video = await client.videos.get("vid_a1b2c3d4e5f6g7");
|
|
253
|
+
const txt = video.textTracks
|
|
254
|
+
.flatMap((t) => t.transcriptRenditions)
|
|
255
|
+
.find((r) => r.format === TranscriptFormat.TXT);
|
|
256
|
+
if (txt?.signedUrl) {
|
|
257
|
+
const transcript = await (await fetch(txt.signedUrl)).text();
|
|
258
|
+
console.log(transcript);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
for (const ins of video.insights) {
|
|
262
|
+
if (ins.status === InsightsStatus.READY) {
|
|
263
|
+
console.log(ins.summary, ins.keyPoints);
|
|
264
|
+
for (const ch of ins.chapters) console.log(ch.startSeconds, ch.title);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Ready-to-paste JSON-LD, video-sitemap entry and HTML fragment for your own page.
|
|
269
|
+
const kit = await client.videos.getSeoMarkup({
|
|
270
|
+
videoId: "vid_a1b2c3d4e5f6g7",
|
|
271
|
+
watchUrl: "https://example.com/watch/42",
|
|
272
|
+
});
|
|
273
|
+
console.log(kit.jsonLd, kit.sitemapEntry, kit.htmlFragment);
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Jobs carry the same data on `job.subtitleResults[i].transcriptRenditions` and
|
|
277
|
+
`job.insights`. The `job.insights.ready` and `job.insights.failed` webhook events
|
|
278
|
+
tell you when an insights pass finishes.
|
|
279
|
+
|
|
230
280
|
## Authentication
|
|
231
281
|
|
|
232
282
|
Pass your API key in the constructor:
|
|
@@ -240,7 +290,7 @@ const client = new Transcodely({ apiKey: process.env.TRANSCODELY_API_KEY! });
|
|
|
240
290
|
```ts
|
|
241
291
|
client.jobs // create / get / list / cancel / confirm / watch
|
|
242
292
|
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
|
|
293
|
+
client.videos // upload RPCs, multipart, createFromUrl, get / list / update / delete / watch / getStats / listTopVideos / getSeoMarkup
|
|
244
294
|
client.presets // create / get / getBySlug / list / update / duplicate / archive
|
|
245
295
|
client.origins // create / get / list / update / validate / archive
|
|
246
296
|
client.ingestRules // create / get / list / update / delete / listEvents / test / replayEvent
|