{"id":15968842,"url":"https://github.com/dolbyio/dolbyio-rest-apis-client-node","last_synced_at":"2026-05-09T01:08:10.015Z","repository":{"id":41846471,"uuid":"428854472","full_name":"DolbyIO/dolbyio-rest-apis-client-node","owner":"DolbyIO","description":"Dolby.io REST APIs Client for Node.JS","archived":false,"fork":false,"pushed_at":"2025-01-22T00:11:00.000Z","size":551,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-16T12:31:43.350Z","etag":null,"topics":["api","dolby","dolbyio","millicast","nodejs","rest-api","sdk","webrtc"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@dolbyio/dolbyio-rest-apis-client","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DolbyIO.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2021-11-17T00:14:00.000Z","updated_at":"2025-01-27T22:08:21.000Z","dependencies_parsed_at":"2024-01-25T00:32:12.173Z","dependency_job_id":"3f055635-4bf2-4e3b-ae99-f2748202de76","html_url":"https://github.com/DolbyIO/dolbyio-rest-apis-client-node","commit_stats":{"total_commits":85,"total_committers":3,"mean_commits":"28.333333333333332","dds":"0.23529411764705888","last_synced_commit":"45dbcf12f084280879538d83ee997dbc55b1fdbc"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DolbyIO%2Fdolbyio-rest-apis-client-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DolbyIO%2Fdolbyio-rest-apis-client-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DolbyIO%2Fdolbyio-rest-apis-client-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DolbyIO%2Fdolbyio-rest-apis-client-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DolbyIO","download_url":"https://codeload.github.com/DolbyIO/dolbyio-rest-apis-client-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244058238,"owners_count":20391064,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api","dolby","dolbyio","millicast","nodejs","rest-api","sdk","webrtc"],"created_at":"2024-10-07T19:04:17.090Z","updated_at":"2026-05-09T01:08:10.009Z","avatar_url":"https://github.com/DolbyIO.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Package](https://github.com/DolbyIO/dolbyio-rest-apis-client-node/actions/workflows/build-package.yml/badge.svg)](https://github.com/DolbyIO/dolbyio-rest-apis-client-node/actions/workflows/build-package.yml)\n[![Build Documentation](https://github.com/DolbyIO/dolbyio-rest-apis-client-node/actions/workflows/build-documentation.yml/badge.svg)](https://github.com/DolbyIO/dolbyio-rest-apis-client-node/actions/workflows/build-documentation.yml)\n[![Publish Package](https://github.com/DolbyIO/dolbyio-rest-apis-client-node/actions/workflows/publish-package.yml/badge.svg)](https://github.com/DolbyIO/dolbyio-rest-apis-client-node/actions/workflows/publish-package.yml)\n[![npm](https://img.shields.io/npm/v/@dolbyio/dolbyio-rest-apis-client)](https://www.npmjs.com/package/@dolbyio/dolbyio-rest-apis-client)\n[![License](https://img.shields.io/github/license/DolbyIO/dolbyio-rest-apis-client-node)](LICENSE)\n[![GitHub](https://img.shields.io/badge/GitHub-_?logo=GitHub\u0026labelColor=black\u0026color=blue)](https://github.com/DolbyIO/dolbyio-rest-apis-client-node)\n[![Documentation](https://img.shields.io/badge/Documentation-_?logo=readthedocs\u0026labelColor=black\u0026color=blue)](https://api-references.dolby.io/dolbyio-rest-apis-client-node/)\n\n[Dolby OptiView](https://optiview.dolby.com/) REST APIs Client for Node.JS is wrapper for the [Dolby OptiView Real-time Streaming](https://optiview.dolby.com/docs/millicast/api/millicast-api/) and Dolby.io Media REST APIs.\n\n# Install this project\n\nRun the npm command to install the package `@dolbyio/dolbyio-rest-apis-client` into your Node project:\n\n```bash\nnpm install @dolbyio/dolbyio-rest-apis-client\n```\n\n# Dolby Millicast Examples\n\n## Create a publish token\n\n```ts\nimport { streaming } from '@dolbyio/dolbyio-rest-apis-client';\n\nconst API_KEY = process.env.DOLBYIO_API_SECRET;\n\nconst publishToken = await streaming.publishToken.create(API_KEY, {\n    label: 'My token',\n    streams: [\n        {\n            streamName: 'feedA',\n        },\n    ],\n});\nconsole.log(publishToken);\n```\n\n## Create a subscribe token\n\n```ts\nimport { streaming } from '@dolbyio/dolbyio-rest-apis-client';\n\nconst API_KEY = process.env.DOLBYIO_API_SECRET;\n\nconst subscribeToken = await streaming.subscribeToken.create(API_KEY, {\n    label: 'My token',\n    streams: [\n        {\n            streamName: 'feedA',\n        },\n    ],\n});\nconsole.log(subscribeToken);\n```\n\n# Media Examples\n\nHere is an example on how to upload a file to the Dolby.io temporary cloud storage, enhance that file and download the result.\n\n## Get an API token\n\nGet the App Key and Secret from the Dolby.io dashboard and use the following code in your python script.\n\n```ts\nimport { media } from '@dolbyio/dolbyio-rest-apis-client';\n\nconst APP_KEY = process.env.DOLBYIO_APP_KEY;\nconst APP_SECRET = process.env.DOLBYIO_APP_SECRET;\n\n// Request an Access Token\nconst jwt = await media.authentication.getApiAccessToken(APP_KEY, APP_SECRET);\nconsole.log('Access token', jwt);\n```\n\n## Upload a file for processing\n\nUpload a media file to the Dolby.io temporary cloud storage for processing:\n\n```ts\n// Temporary storage URL that will be used as reference for the job processing\nconst inputUrl = 'dlb://in/file.mp4';\n// Local path of the file to upload\nconst originalFilePath = '/path/to/original_file.mp4';\n\nawait media.io.uploadFile(jwt, inputUrl, originalFilePath);\n```\n\n## Start an enhance job\n\nGenerate a job description and send it to Dolby.io.\n\n```ts\n// Temporary storage URL that will be used as reference for the job processing\nconst outputUrl = 'dlb://out/file.mp4';\n\nconst jobDescription = JSON.stringify({\n    content: { type: 'podcast' },\n    input: inputUrl,\n    output: outputUrl,\n});\n\nconst jobId = await media.enhance.start(jwt, jobDescription);\nconsole.log(`Job ID: ${jobId}`);\n```\n\n## Wait for the job to complete\n\nGet the job status and wait until it is completed.\n\n```javascript\nconst sleep = (delay) =\u003e new Promise((r) =\u003e setTimeout(r, delay));\n\nlet result = await media.enhance.getResults(jwt, jobId);\nwhile (result.status === 'Pending' || result.status === 'Running') {\n    console.log(`Job status is ${result.status}, taking a 5 second break...`);\n    await sleep(5000);\n\n    result = await media.enhance.getResults(jwt, jobId);\n}\n\nif (result.status !== 'Success') {\n    console.error('There was a problem with processing the file', result);\n    return;\n}\n```\n\n## Download a processed file\n\nAt this stage, the file has been processed and written to the temporary storage so we can download it.\n\n```javascript\n// Local path where to download the file to\nconst enhancedFilePath = '/path/to/enhanced_file.mp4';\n\nawait media.io.downloadFile(jwt, outputUrl, enhancedFilePath);\n```\n\n# Logs\n\nYou can also print the logs in the console and select the log level by using the following code.\n\n```ts\nimport { Logger } from '@dolbyio/dolbyio-rest-apis-client';\n\nLogger.useDefaults({\n    defaultLevel: Logger.TRACE,\n});\n```\n\n# How to\n\nTo build the `dist` folder, run the command:\n\n```bash\nnpm run build\n```\n\nThe documentation is built on [TypeDoc](https://typedoc.org), to generate the doc, run the following command. You will find the HTML files in the `docs` folder.\n\n```bash\nnpm run docs\n```\n\n## Related Projects\n\n- [TypeDoc](https://typedoc.org)\n- [js-logger](https://github.com/jonnyreeves/js-logger)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolbyio%2Fdolbyio-rest-apis-client-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdolbyio%2Fdolbyio-rest-apis-client-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdolbyio%2Fdolbyio-rest-apis-client-node/lists"}