Menu

Generate VideoObject JSON-LD and a video sitemap from your video API data (Node.js)
📰

Generate VideoObject JSON-LD and a video sitemap from your video API data (Node.js)

DEV Community: node·Mason K·3 days ago
#FXCwDrBz
#devtonodejs#devto#dev#duration#const
Reading 0:00
15s threshold

TL;DR

We'll build two small Node.js modules: one renders VideoObject JSON-LD from an asset record, one renders a video sitemap. Then a test fails the build when required fields are missing. Node 22, no dependencies.

What we're building 🧱

Your video backend, whichever API you use, gives you per-asset data: title, duration, thumbnail, created date, a playback URL. We'll map that to the markup Google documents. Per Google's video structured data page , name , thumbnailUrl and uploadDate are required; description , duration , contentUrl , embedUrl and others are recommended.

1.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.