{"id":35354801,"url":"https://github.com/video-db/videodb-node","last_synced_at":"2026-02-12T16:01:00.511Z","repository":{"id":218879190,"uuid":"737186419","full_name":"video-db/videodb-node","owner":"video-db","description":"VideoDB Nodejs SDK","archived":false,"fork":false,"pushed_at":"2026-02-07T08:23:31.000Z","size":386,"stargazers_count":12,"open_issues_count":5,"forks_count":10,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-07T17:59:57.542Z","etag":null,"topics":["database","llm","mutimodal","node","rag","video"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/videodb","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/video-db.png","metadata":{"files":{"readme":"Readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-30T05:31:38.000Z","updated_at":"2026-01-23T15:24:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"e3249f56-d2f3-46a8-9a84-837d8429f972","html_url":"https://github.com/video-db/videodb-node","commit_stats":null,"previous_names":["video-db/videodb-node"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/video-db/videodb-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/video-db%2Fvideodb-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/video-db%2Fvideodb-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/video-db%2Fvideodb-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/video-db%2Fvideodb-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/video-db","download_url":"https://codeload.github.com/video-db/videodb-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/video-db%2Fvideodb-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29371387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","llm","mutimodal","node","rag","video"],"created_at":"2026-01-01T22:09:23.793Z","updated_at":"2026-02-12T16:01:00.492Z","avatar_url":"https://github.com/video-db.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- PROJECT SHIELDS --\u003e\n\u003c!--\n*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).\n*** https://www.markdownguide.org/basic-syntax/#reference-style-links\n--\u003e\n\n[![Npm Version][npm-shield]][npm-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![Website][website-shield]][website-url]\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://videodb.io/\"\u003e\n    \u003cimg src=\"https://codaio.imgix.net/docs/_s5lUnUCIU/blobs/bl-RgjcFrrJjj/d3cbc44f8584ecd42f2a97d981a144dce6a66d83ddd5864f723b7808c7d1dfbc25034f2f25e1b2188e78f78f37bcb79d3c34ca937cbb08ca8b3da1526c29da9a897ab38eb39d084fd715028b7cc60eb595c68ecfa6fa0bb125ec2b09da65664a4f172c2f\" alt=\"Logo\" width=\"300\" height=\"\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003eVideoDB Node.js SDK\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Video Database for your AI Applications\n    \u003cbr /\u003e\n    \u003ca href=\"https://docs.videodb.io\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/video-db/videodb-node/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/video-db/videodb-node/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n\n# VideoDB Node.js SDK\n\nVideoDB Node.js SDK allows you to interact with the VideoDB serverless database. Manage videos as intelligent data, not files. It's scalable, cost efficient \u0026 optimized for AI applications and LLM integration.\n\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n# Table of Contents\n\n- [About The Project](#videoDB-nodejs-sdk)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n  * [Creating a Connection](#creating-a-connection)\n  * [Getting a Connection](#getting-a-collection)\n- [Working with a single video](#working-with-a-single-video)\n  * [⬆️ Upload Video](#upload-video)\n  * [📺 View your Video](#view-your-video)\n  * [⛓️ Stream Sections of videos](#stream-sections-of-videos)\n  * [🗂️ Indexing a Video](#indexing-a-video)\n  * [🔍 Searching inside a video](#searching-inside-a-video)\n  * [Viewing Search Results](#viewing-search-results)\n- [RAG: Search inside Multiple Videos](#rag-search-inside-multiple-videos)\n  * [🔄 Using Collection to Upload Multiple Videos](#using-collection-to-upload-multiple-videos)\n  * [📂 Search inside multiple videos in a collection](#search-inside-multiple-videos-in-a-collection)\n- [Timeline And Assets](#timeline-and-assets)\n  * [Understanding Assets](#understanding-assets)\n  * [Creating Assets](#creating-assets)\n    * [VideoAsset](#videoasset)\n    * [AudioAsset](#audioasset)\n    * [ImageAsset](#imageasset)\n    * [TextAsset](#textasset)\n  * [Understanding Timeline](#understanding-timeline)\n  * [Creating Timeline](#creating-timeline)\n- [More on `Video` object](#more-on-video-object)\n  * [Get the video's transcript](#get-the-videos-transcript)\n  * [Get the video's thumbnail](#get-the-videos-thumbnail)\n  * [Overlay Subtitle on video](#overlay-subtitle-on-video)\n  * [Delete the video](#delete-the-video)\n- [More on `Collection` object](#more-on-collection-object)\n  * [Get all videos](#get-all-videos)\n  * [Get a video given videoId](#get-a-video-given-videoid)\n  * [Delete a video](#delete-a-video)\n- [Roadmap](#roadmap)\n- [Contributing](#contributing)\n- [License](#license)\n\n\u003c!-- Installation --\u003e\n\n## Installation\n\nTo install the package, run the following command in your terminal:\n\n```\nnpm install videodb\n```\n\n\u003c!-- USAGE EXAMPLES --\u003e\n\n## Quick Start\n\n#### Creating a Connection\n\nGet an API key from the [VideoDB console](https://console.videodb.io). Free for first 50 uploads (No credit card required).\n\n```ts\nimport { connect } from 'videodb';\n\n// create a connection to the VideoDB API\nconst conn = connect('YOUR_API_KEY');\n```\n\n#### Getting a Collection\n\nA default collection is created when you create your first connection. Use the `getCollection` method on the established database connection to get the `Collection` object.\n\n```ts\n// Get Default collection\nconn\n  .getCollection()\n  .then(coll =\u003e console.log('Collection Id : ', coll.meta.id));\n```\n\nOr using `async`/`await`\n\n```ts\n// Get Default Collection\n(async () =\u003e {\n  const coll = await conn.getCollection();\n  console.log('Collection Id : ', coll.meta.id);\n})();\n```\n\n## Working with a single video\n\n#### Upload Video\n\nNow that you have established a connection to VideoDB, you can upload your videos using `coll.uploadURL()` or `coll.uploadFile()`.  \nYou can directly upload files from `youtube`, `any public url`, `S3 bucket` or a `local file path`. A default collection is created when you create your first connection.\n\n```ts\n// upload to the default collection using url which returns an upload job\nconst uploadJob = await coll.uploadURL({\n  url: 'https://www.youtube.com/watch?v=WDv4AWk0J3U',\n});\n\n// Attach optional event listeners\nuploadJob.on('success', uploadedVideo =\u003e\n  console.log('Video Uploaded. VideoID : ', uploadedVideo.meta.id)\n);\nuploadJob.on('error', err =\u003e {\n  console.error(err);\n});\n\n// Call the start function to commence the upload\nuploadJob.start();\n```\n\n#### View your Video\n\nOnce uploaded, your video is immediately available for viewing in 720p resolution. ⚡️\n\nGenerate a streamable url for the video using `video.generateStream()`  \nGet a browser playable link using `video.play()`\n\n```ts\n// Replace {VIDEO_ID} with your video id\nconst video = await coll.getVideo('VIDEO_ID');\n\n// Generate a preview stream for video\nconst playerUrl = await video.play();\nconsole.log('Video Preview : ', playerUrl);\n```\n\n#### Stream Sections of videos\n\nYou can easily clip specific sections of a video by passing a timeline of the start and end timestamps (in seconds) as a parameter.\nFor example, this will generate a streaming URL for a compilation of the fist `10 seconds`, and the part between the `120th` and the `140th` second.\n\n```ts\nimport { playStream } from 'videodb';\n\nconst streamLink = await video.generateStream([\n  [0, 10],\n  [120, 140],\n]);\n\nconst streamPreview = playStream(streamLink);\nconsole.log('Clipped Video Preview : ', streamPreview);\n```\n\n#### Indexing a Video\n\nTo search bits inside a video, you have to first index the video. This can be done by a invoking the index function on the `Video`. VideoDB offers two type of indexes currently.\n\n1. `indexSpokenWords`: Indexes spoken words in the video. It automatically generate the transcript and makes it ready for search.\n2. `indexScenes`: Indexes visual concepts and events of the video.\n\n\u003e (Note: This feature is currently available only for beta users, join our [discord](https://discord.com/invite/py9P639jGz) for early access)\n\n```ts\n// best for podcasts, elearning, news, etc.\nconst job1 = video.indexSpokenWords();\njob1.start();\n\n// best for camera feeds, moderation usecases etc.\nconst job2 = video.indexScenes();\njob2.start();\n```\n\n\u003e In future you can also index videos using:\n\u003e\n\u003e 1.  Faces : Upload image of the person and find them in a video.\n\u003e 2.  Specific domain Index like Football, Baseball, Drone footage, Cricket etc.\n\u003e\n\u003e ⏱️ Indexing may take some time for longer videos, structure it as a batch job in your application.\n\n#### Searching inside a video\n\nSearch the segments inside a video. While searching you have options to choose the type of search. VideoDB offers following type of search :\n\n- `semantic`: Perfect for question answer kind of queries. This is also the default type of search.\n\n- `keyword`: It matches the exact occurance of word or sentence you pass in the query parameter of the search function. keyword search is only available to use with single videos.\n\n- `scene` : It search the visual information of the video, Always Index the videousing index_scenes function before using this search.\n\n```ts\nconst indexJob = video.indexSpokenWords();\n\nindexJob.on('success', async () =\u003e {\n  const results = await video.search('Morning Sunlight', 'semantic');\n  const resultsUrl = await results.play();\n  console.log('Search results preview : ', resultsUrl);\n});\n\nindexJob.start();\n```\n\nSimilarly, you can index and search from scenes using `Video.indexScenes()`\n\n#### Viewing Search Results\n\n`video.search()` will return a `SearchResult` object, which contains the sections or as we call them, `shots` of videos which semantically match your search query.\n\n- `result.shots` Returns a list of `Shot`(s) that matched the search query. You can call `generateStream()` on each shot to get the corresponding streaming URL.\n- `result.play()` Compiles and returns a playable url for the compiled shots (similar to `video.play()`). You can open this link in the browser, or embed it into your website using an iframe.\n\n## RAG: Search inside Multiple Videos\n\n`VideoDB` can store and search inside multiple videos with ease. By default, videos are uploaded to your default collection.\n\n#### Using Collection to Upload Multiple Videos\n\n```ts\nconst uploadJobHandler = video =\u003e {\n  console.log(`Video uploaded :${video.meta.name}`);\n};\n\n// Upload Video1 to VideoDB\nconst job1 = await coll.uploadURL({\n  url: 'https://www.youtube.com/watch?v=lsODSDmY4CY',\n});\njob1.on('success', uploadJobHandler);\njob1.start();\n\n// Upload Video2 to VideoDB\nconst job2 = await coll.uploadURL({\n  url: 'https://www.youtube.com/watch?v=vZ4kOr38JhY',\n});\njob2.on('success', uploadJobHandler);\njob2.start();\n\n// Upload Video3 to VideoDB\nconst job3 = await coll.uploadURL({\n  url: 'https://www.youtube.com/watch?v=uak_dXHh6s4',\n});\njob3.on('success', uploadJobHandler);\njob3.start();\n```\n\n- `Connection.getCollection()` : Returns Collection object, the default collection\n- `Collection.getVideo()` : Returns list of Video, all videos in collections\n- `Collection.getVideo(videoId)`: Returns Video, respective video object from given `videoId`\n- `Collection.deleteVideo(videoId)`: Deletes the video from Collection\n\n#### Search inside multiple videos in a collection\n\nYou can simply Index all the videos in a collection and use the search method to find relevant results. Here we are indexing the spoken content of a collection and performing semantic search.\n\n```ts\nconst indexJobHandler = res =\u003e {\n  console.log(`Video Indexed : `, res);\n};\n\nconst videos = await coll.getVideos();\nconsole.log('Total videos', videos.length);\n\nfor (let video of videos) {\n  const indexJob = await video.indexSpokenWords();\n  indexJob.on('success', indexJobHandler);\n  indexJob.start();\n}\n```\n\n**Semantic Search in the collection**\n\n```ts\nconst searchRes = await coll.search('What is dopamine');\nconst resultsUrl = await searchRes.play();\n\nconsole.log('Search Result Preview : ', resultsUrl);\n```\n\nThe result here has all the matching bits in a single stream from your collection. You can use these results in your application right away.\n\n\u003e As you can see VideoDB fundamentally removes the limitation of files and gives you power to access and stream videos in a very seamless way. Stay tuned for exciting features in our upcoming version and keep building awesome stuff with VideoDB 🤘\n\n## Timeline And Assets\n\n**Timeline and Assets** lets you create programmatic compilation streams with audio, image and text overlays using your video data in VideoDB.\n\n### Understanding Assets\n\nAssets are objects that you can use in your video timeline. These Assets have lots of configurable setting available.\n\n### Creating Assets\n\nTo define any asset, you must provide the identifier of the media and specify the segment of the media with start and end parameters, some assets have lots of other configurable settings available.\n\n#### VideoAsset\n\nA Video Asset can be created by calling [`VideoAsset()`](https://github.com/video-db/videodb-node/blob/main/docs/classes/core_asset.VideoAsset.md#constructor)\n\n```ts\nimport { VideoAsset } from 'videodb';\n\nconst videoAsset = new VideoAsset('MEDIA_ID', { start: 0, end: 20 });\n```\n\n#### AudioAsset\n\nAn Audio Asset can be created by calling [`AudioAsset()`](https://github.com/video-db/videodb-node/blob/main/docs/classes/core_asset.AudioAsset.md#constructor)\n\n```ts\nimport { AudioAsset } from 'videodb';\n\nconst audioAsset = new AudioAsset('MEDIA_ID', { start: 0, end: 10 });\n```\n\n#### ImageAsset\n\nAn Image Asset can be created by calling [`ImageAsset()`](https://github.com/video-db/videodb-node/blob/main/docs/classes/core_asset.ImageAsset.md#constructor)\n\n```ts\nimport { ImageAsset } from 'videodb';\n\nconst imageAsset = new ImageAsset('MEDIA_ID', { x: 10, y: 10, duration: 5 });\n```\n\n#### TextAsset\n\nA Text Asset can be created by calling [`TextAsset()`](https://github.com/video-db/videodb-node/blob/main/docs/classes/core_asset.TextAsset.md#constructor)\n\n```ts\nimport { TextAsset } from 'videodb';\n\n// Defult Style\nconst textAsset1 = new TextAsset({ text: 'Hello World!' });\n\n// Configured Style\nconst textAsset2 = new TextAsset({\n  text: 'Hello World!',\n  style: { fontsize: 16, alpha: 0.8 },\n});\n```\n\n### Understanding Timeline\n\n`Timeline` let's you add your organise your asset in a Video Timeline and generate stream for your timeline.\n\n### Creating Timeline\n\nTimeline can be created by calling [`Timeline()`](https://github.com/video-db/videodb-node/blob/main/docs/classes/core_timeline.Timeline.md) constructor\n\nThe `Timeline` object provides you with following methods:\n\n- [`addInline()`](https://github.com/video-db/videodb-node/blob/main/docs/classes/core_timeline.Timeline.md#addinline) : adds `VideoAsset` inline\n- [`addOverlay()`](https://github.com/video-db/videodb-node/blob/main/docs/classes/core_timeline.Timeline.md#addOverlay): adds `AudioAsset`, `ImageAsset` and `TextAsset` as overlay\n- [`generateStream()`](https://github.com/video-db/videodb-node/blob/main/docs/classes/core_timeline.Timeline.md#generateStream): generates stream for your timeline\n\n```ts\nimport { Timeline, playStream } from 'videodb';\n\n// Create a Timeline \nconst timeline = Timeline(conn);\n\n// Add VideoAsset inline\ntimeline.addInline(videoAsset);\n\n// Add AudioAsset overlay\ntimeline.addOverlay(0, audioAsset);\n\n// Generate and play stream\nconst streamUrl = timeline.generateStream();\nconsole.log(playStream(streamUrl));\n```\n\n## 🌟 More on `Video` object\n\nThere are multiple useful functions available on a `Video` Object:\n\n#### Get the video's transcript\n\n```ts\nconst transcriptJob = video.getTranscript();\ntranscriptJob.on('success', transcript =\u003e {\n  console.log(transcript);\n});\ntranscriptJob.start();\n```\n\n#### Get the video's thumbnail\n\n```ts\n// Get thumbnail of the video\nconst thumbnail = await video.generateThumbnail();\nconsole.log(thumbnail);\n```\n\n#### Overlay Subtitle on video\n\n```ts\nlet subtitleStream = await video.addSubtitle();\nlet playerUrl = playStream(subtitleStream);\nconsole.log(playerUrl);\n```\nSubtitles Can be styled by passing a Object of Type [`Partial\u003cSubtitleStyleProps\u003e`](https://github.com/video-db/videodb-node/blob/main/docs/modules/types_config.md#subtitlestyleprops) in `Video.addSubtitle()`\n\n```ts\nsubtitleStream = await video.addSubtitle({fontSize: 12});\nplayerUrl = await playStream(subtitleStream);\nconsole.log(playerUrl);\n```\n\n#### Delete the video\n\n```ts\n// Delete the video from the collection\nawait video.delete();\n```\n\n### 🌟 More on `Collection` object\n\n#### Get all videos\n\n```ts\nconst allVideos = coll.getVideo();\n```\n\n#### Get a video given videoId\n\n```ts\nconst myVideo = coll.getVideo(id);\n```\n\n#### Delete a video\n\n```ts\nawait coll.deleteVideo();\n```\n\n---\n\n\u003c!-- ROADMAP --\u003e\n\n## Roadmap\n\n- Adding More Indexes : `Face`, `Scene`, `Security`, `Events`, and `Sports`\n- Give prompt support to generate thumbnails using GenAI.\n- Give prompt support to access content.\n- Give prompt support to edit videos.\n- See the [open issues](https://github.com/video-db/videodb-node/issues) for a list of proposed features (and known issues).\n\n---\n\n\u003c!-- CONTRIBUTING --\u003e\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n---\n\n\u003c!-- LICENSE --\u003e\n\n## License\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n\n[npm-shield]: https://img.shields.io/npm/v/videodb?style=for-the-badge\n[npm-url]: https://www.npmjs.com/package/videodb\n[stars-shield]: https://img.shields.io/github/stars/video-db/videodb-node.svg?style=for-the-badge\n[stars-url]: https://github.com/video-db/videodb-node/stargazers\n[issues-shield]: https://img.shields.io/github/issues/video-db/videodb-node.svg?style=for-the-badge\n[issues-url]: https://github.com/video-db/videodb-node/issues\n[website-shield]: https://img.shields.io/website?url=https%3A%2F%2Fvideodb.io%2F\u0026style=for-the-badge\u0026label=videodb.io\n[website-url]: https://videodb.io/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvideo-db%2Fvideodb-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvideo-db%2Fvideodb-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvideo-db%2Fvideodb-node/lists"}