@stremio-addon/compat
v1.0.0
Published
Drop-in compatibility package to adopt addons built with the official Stremio Addon SDK
Downloads
382
Readme
@stremio-addon/compat
This package is part of Stremio-Community/stremio-addon-sdk.
Drop-in compatibility layer for migrating from the official Stremio Addon SDK to the community Stremio Addon SDK.
Features
- 🔄 Easy migration - Drop-in replacement for the official SDK
- ✅ Compatible API - Same interface as
stremio-addon-sdk - 🚀 Modern foundation - Powered by the new community SDK packages
Installation
pnpm add @stremio-addon/compatUsage
Replace your import from stremio-addon-sdk with @stremio-addon/compat:
// Before (official SDK)
import { addonBuilder, serveHTTP, getRouter } from "stremio-addon-sdk";
// After (community SDK)
import { addonBuilder, serveHTTP, getRouter } from "@stremio-addon/compat";
// The rest of your code stays the same!
const builder = new addonBuilder(manifest);
builder.defineStreamHandler(async ({ type, id }) => {
return { streams: [...] };
});
serveHTTP(builder.getInterface(), { port: 3000 });What's Included
This package provides:
addonBuilder- Compatible with the official SDK'saddonBuilderserveHTTP- Function to serve your addon over HTTPgetRouter- Express router factorypublishToCentral- Function to publish to the Stremio addon catalog
Migration Path
This compatibility package makes it easy to migrate gradually:
- Phase 1: Replace
stremio-addon-sdkwith@stremio-addon/compat - Phase 2: Gradually adopt new features from the community SDK
- Phase 3: Eventually migrate to direct usage of
@stremio-addon/sdk
For a detailed migration guide, see MIGRATION.md.
Architecture
Under the hood, this package uses:
@stremio-addon/sdk- Core SDK@stremio-addon/linter- Validation (same as official SDK)@stremio-addon/node-express- Express integration
Related Packages
@stremio-addon/sdk- Core SDK package (recommended for new projects)- Official Stremio Addon SDK - Original SDK
License
MIT
