Overview
This guide walks you through creating a basic Stremio addon that provides movie catalogs and streams. We’ll build a simple HTTP server that implements the addon protocol.While this guide uses Rust examples, you can create addons in any language that can serve HTTP. The official addon SDK provides JavaScript/Node.js implementation.
Prerequisites
- Understanding of HTTP and JSON
- Web server framework in your language of choice
- Basic knowledge of the manifest structure
- Familiarity with resource types
Step 1: Create the Manifest
The manifest defines your addon’s capabilities. Create a JSON file or endpoint at/manifest.json:
manifest.json
Step 2: Implement the Catalog Resource
Create an endpoint at/catalog/{type}/{id}.json:
catalog-handler.js
Key Points
Pagination
Pagination
Use the
skip parameter to implement pagination. Return up to 100 items per page.Required Fields
Required Fields
Each meta must have
id, type, and name. Other fields are optional but recommended.Poster Images
Poster Images
Provide high-quality poster URLs. Use
posterShape to indicate aspect ratio.Step 3: Implement the Stream Resource
Create an endpoint at/stream/{type}/{id}.json:
stream-handler.js
Stream Types
Direct URL
Torrent
YouTube
External
Step 4: Add CORS Headers
cors-middleware.js
Step 5: Test Your Addon
Local Testing
- Start your server:
- Test the manifest:
- Test a catalog:
- Test streams:
Install in Stremio
For local testing, use a tunneling service like ngrok:- Go to Addons
- Click the puzzle icon (Community Addons)
- Paste your ngrok URL with
/manifest.json - Click Install
Complete Example
Here’s a minimal working addon server:server.js
Advanced Features
Meta Resource
Provide detailed information with episodes:Subtitles Resource
Configuration
For configurable addons:Deployment
Vercel
Deploy serverless Node.js addons
Heroku
Deploy any language/framework
Railway
Easy deployment with automatic HTTPS
Deployment Checklist
Best Practices
Performance
Performance
- Cache responses when possible
- Use CDNs for images and static content
- Implement pagination for large catalogs
- Return empty arrays instead of errors when no content is available
Error Handling
Error Handling
- Return
{ streams: [] }when no streams are available - Return
{ metas: [] }for empty catalogs - Use appropriate HTTP status codes
- Log errors for debugging
Content
Content
- Use high-quality poster images
- Provide accurate metadata
- Include descriptions and release information
- Use standard ID formats (IMDb, TMDB, etc.)
Security
Security
- Validate all input parameters
- Rate limit your endpoints
- Don’t expose API keys in responses
- Use HTTPS in production
Resources
Official SDK
JavaScript/Node.js addon SDK
Addon Examples
Example addons and templates
Testing Tool
Validate your addon manifest
Community
Get help from the community
Next Steps
- Explore the manifest reference for advanced configuration
- Learn about different stream sources
- Implement meta resources for detailed information
- Add subtitles support
- Publish your addon to the community!
