{"id":13466174,"url":"https://github.com/Stremio/stremio-addon-sdk","last_synced_at":"2025-03-25T21:31:31.479Z","repository":{"id":40764571,"uuid":"127441354","full_name":"Stremio/stremio-addon-sdk","owner":"Stremio","description":"🧙 A Node.js SDK for creating and publishing Stremio add-ons","archived":false,"fork":false,"pushed_at":"2024-08-21T13:56:36.000Z","size":1073,"stargazers_count":668,"open_issues_count":58,"forks_count":179,"subscribers_count":75,"default_branch":"master","last_synced_at":"2024-10-26T11:50:49.189Z","etag":null,"topics":["media-center","stremio","video-streaming"],"latest_commit_sha":null,"homepage":"https://www.stremio.com/addon-sdk","language":"JavaScript","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/Stremio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2018-03-30T15:08:45.000Z","updated_at":"2024-10-25T23:03:53.000Z","dependencies_parsed_at":"2023-10-11T10:46:28.104Z","dependency_job_id":"db7c2591-7b32-4aee-9e14-896255670584","html_url":"https://github.com/Stremio/stremio-addon-sdk","commit_stats":{"total_commits":582,"total_committers":19,"mean_commits":30.63157894736842,"dds":"0.48453608247422686","last_synced_commit":"63f6e38baf9f884d4510c39bbe8514547106fba1"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stremio%2Fstremio-addon-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stremio%2Fstremio-addon-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stremio%2Fstremio-addon-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stremio%2Fstremio-addon-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Stremio","download_url":"https://codeload.github.com/Stremio/stremio-addon-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221845734,"owners_count":16890668,"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":["media-center","stremio","video-streaming"],"created_at":"2024-07-31T15:00:40.326Z","updated_at":"2025-03-25T21:31:31.471Z","avatar_url":"https://github.com/Stremio.png","language":"JavaScript","funding_links":[],"categories":["others","JavaScript","Addon Developer Resources"],"sub_categories":["Catalogs"],"readme":"# Stremio Addon SDK 🧙\n\n\u003cimg src=\"https://blog.stremio.com/wp-content/uploads/2023/08/stremio-logo-2023.png\" alt=\"Stremio\" width=\"250\" /\u003e\n\nThe **🧙  Stremio Addon SDK 🧙** was developed by the Stremio Team as a way of vastly simplifying Node.js addon creation for\nour streaming platform.\n\nStremio currently supports Windows, macOS, Linux, Android and iOS.\n\n**Important: We strongly recommend deploying addons to the [BeamUp](./docs/deploying/beamup.md) servers**\n\n\n## Quick Example\n\nThis arbitrary example creates an addon that provides a stream for Big Buck Bunny and outputs a HTTP address where you can access it.\n\n```javascript\nconst { addonBuilder, serveHTTP, publishToCentral }  = require('stremio-addon-sdk')\n\nconst builder = new addonBuilder({\n    id: 'org.myexampleaddon',\n    version: '1.0.0',\n\n    name: 'simple example',\n\n    // Properties that determine when Stremio picks this addon\n    // this means your addon will be used for streams of the type movie\n    catalogs: [],\n    resources: ['stream'],\n    types: ['movie'],\n    idPrefixes: ['tt']\n})\n\n// takes function(args)\nbuilder.defineStreamHandler(function(args) {\n    if (args.type === 'movie' \u0026\u0026 args.id === 'tt1254207') {\n        // serve one stream to big buck bunny\n        const stream = { url: 'http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4' }\n        return Promise.resolve({ streams: [stream] })\n    } else {\n        // otherwise return no streams\n        return Promise.resolve({ streams: [] })\n    }\n})\n\nserveHTTP(builder.getInterface(), { port: process.env.PORT || 7000 })\n//publishToCentral(\"https://your-domain/manifest.json\") // \u003c- invoke this if you want to publish your addon and it's accessible publically on \"your-domain\"\n```\n\nSave this as `addon.js` and run:\n\n```bash\nnpm install stremio-addon-sdk\nnode ./addon.js\n```\n\nIt will output a URL that you can use to [install the addon in Stremio](./docs/testing.md#how-to-install-add-on-in-stremio)\n\n**Please note:** addon URLs in Stremio must be loaded with HTTPS (except `127.0.0.1`) and must support CORS! CORS support is handled automatically by the SDK, but if you're trying to load your addon remotely (not from `127.0.0.1`), you need to support HTTPS.\n\n\n## Getting started with a new addon\n\nIn order to scaffold a new Stremio addon, we've made a tool called `addon-bootstrap`.\n\nYou can use it in the following way:\n\n```bash\nnpm install -g stremio-addon-sdk # use sudo if on Linux\naddon-bootstrap hello-world\n```\n\nYou'll be asked about what [resources and types](./docs/api/README.md) you want to support, after which the addon will be created in the `hello-world` directory, and you'll be able to run it:\n\n```bash\ncd hello-world\nnpm install\nnpm start -- --launch\n```\n\nIf you wish to install the addon in the Desktop version of Stremio (which you can [download here](https://www.stremio.com/downloads)), you should use `npm start -- --install`\n\n## Documentation\n\nAll our documentation is [right here on GitHub](./docs). Take a look at our [examples list](./docs/examples.md) for some high-level\ninformation, or dive straight into our [SDK documentation](./docs/README.md) for our code reference docs.\n\nWe also have an [example addon](https://github.com/Stremio/addon-helloworld) that you can use as a guide to help you build your own addon.\n\nWe've made two step by step guides: one for this SDK, and one for any programming language, [which you can read here](https://stremio.github.io/stremio-addon-guide).\n\nIf you don't wish to use Node.js (and therefore not use this SDK either), you can create addons in any programming\nlanguage, see the [addon protocol specification](./docs/protocol.md) for more information.\n\nIt is also possible to create an addon without any programming language, see our [static addon example](https://github.com/Stremio/stremio-static-addon-example) based\non the protocol specification.\n\nSDK Features Include:\n\n- Publishing an addon through HTTP(s)\n- Publishing your addon link to the [public Addon collection](https://api.strem.io/addonscollection.json) with [publishToCentral](./docs/README.md#publishtocentralurl)\n- Creating a homepage for your addon that includes an \"Install Addon\" button\n\n## Testing\n\nFor developers looking for a quick way to test their new addons, you can either:\n\n- [Test with Stremio](./docs/testing.md#testing-in-stremio-app)\n- [Test with our Web Version](./docs/testing.md#testing-in-stremio-web-version)\n\n\n## Deploying\n\nIn order for your addon to be used by others, it needs to be deployed online.\n\nYou can check our [list of recommended hosting providers for Node.js](./docs/deploying/README.md) or alternatively host it locally with [localtunnel](https://github.com/localtunnel/localtunnel).\n\nAfter you've deployed publically, in order to get your addon to show in Stremio (through the [public Addon collection](https://api.strem.io/addonscollection.json)), you need to use [publishToCentral](./docs/README.md#publishtocentralurl) or publish [manually through the UI](https://stremio.github.io/stremio-publish-addon/index.html).\n\n## Examples \u0026 tutorials\n\nCheck out our ever growing list of [examples and demo addons](./docs/examples.md). This list also includes examples \u0026 tutorials on how to develop Stremio addons in PHP, Python, Ruby, C#, Rust, Java and Go. It also includes a list of video tutorials.\n\n### Rust version\nThere is a third-party Rust version of this SDK built on stremio-core developed by Sleeyax [here](https://github.com/sleeyax/stremio-addon-sdk-rs).\n\n### Go version\nThere is a third-party Go version of this SDK developed by doingodswork [here](https://github.com/Deflix-tv/go-stremio).\n\n\n## Advanced Usage\n\nRead our [guide for advanced usage](./docs/advanced.md) to understand the many ways that addons can be used.\n\n\n## Reporting Issues\n\nIf you have any issues regarding the Stremio Addon SDK, please feel free to [report them here](https://github.com/Stremio/stremio-addon-sdk/issues).\n\n\n## Migration from v0.x\n\nTo migrate from v0.x, you need to:\n\n- change `new addonSDK` to `new addonBuilder`, which you can import via `const addonBuilder = require('stremio-addon-sdk').addonBuilder`\n- change `addon.run(opts)` to `serveHTTP(addon.getInterface(), opts)`, which you can import via `const serveHTTP = require('stremio-addon-sdk').serveHTTP`\n- all handlers have to return a `Promise` (rather than take a `cb`)\n\n\n## Use Cases Outside Addon SDK\n\nThe use of this SDK is not mandatory for creating Stremio Addons. You can use any programming language that supports\ncreating a HTTP server to make Stremio Addons. Refer to our [protocol specification](./docs/protocol.md) for details and examples.\n\nOne useful scenario of not using the SDK is when you need user specific data for you addon (for example, an API\nAutherntication Token), you can see an example of passing user specific data in the Addon URL [here](./docs/advanced.md#using-user-data-in-add-ons).\nThis example uses Node.js and Express to get user specific data. (Update: the Addon SDK now supports [user settings](./docs/api/responses/manifest.md#user-data))\n\n\n_built with love and serious coding skills by the Stremio Team_\n\n\u003cimg src=\"https://blog.stremio.com/wp-content/uploads/2023/08/stremio-code-footer.jpg\" width=\"300\" /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStremio%2Fstremio-addon-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStremio%2Fstremio-addon-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStremio%2Fstremio-addon-sdk/lists"}