Skip to main content

Overview

Stremio Core is a Rust crate designed to contain all the reusable logic between Stremio versions. It provides a flexible, correct, and modern foundation for building full-featured media center applications.
Stremio is a full-featured media center designed to help you organize and stream your favorite videos, movies, and TV series. It notifies you for new episodes/movies and helps you discover new content.

Key Features

Cross-Stack Integration

Flexible enough to integrate into existing code bases across the entire stack and in different paradigms

Type Safety

Comprehensive type system that can be used by add-ons and applications

Elm Architecture

State management inspired by the Elm architecture with clear Effects and Update patterns

Add-on System

Built-in support for Stremio’s powerful add-on system for extending functionality

Design Goals

Flexibility

Stremio Core is designed to be integrated in multiple ways:
  • Type Library: The types module can be used standalone by add-ons
  • Authentication Layer: Can be integrated as an addition to existing apps with their own user authentication
  • Full Context Model: Use the Ctx model as a backbone to manage user authentication, add-ons, and the entire Stremio app

Emphasis on Correctness

The crate prioritizes correctness and type safety, leveraging Rust’s strong type system to prevent bugs at compile time.

No Legacy Burden

Built fresh without being constrained by obsolete decisions and solutions from previous implementations.

Core Modules

Stremio Core is organized into several key modules:

Types

Core data structures and types used throughout the application:
  • addon: Add-on descriptors and manifests
  • profile: User profiles, authentication, and settings
  • library: Library items and collections
  • streams: Stream metadata and state
  • resource: Meta items, videos, and catalogs

Runtime

The runtime system that powers the application:
  • Environment trait: Abstracts platform-specific operations (fetch, storage)
  • Runtime: Handles effects automatically and manages the event loop
  • Messages: Actions, events, and internal messages
  • Effects: Async operations and side effects

Models

Stateful models that implement the Update trait:
  • Ctx: Manages user authentication, add-ons, library, and streams
  • CatalogWithFilters: Filtered catalog browsing
  • MetaDetails: Detailed metadata view
  • Player: Video playback state
  • Calendar: Content calendar view
  • LibraryWithFilters: Filtered library view

Addon Transport

Handles communication with add-ons and implements legacy protocol adapters.

Architecture

Stremio Core follows the Elm Architecture pattern:
┌─────────────┐
│   Model     │  ◄──  State container
└──────┬──────┘


┌─────────────┐
│   Update    │  ◄──  Pure update function
└──────┬──────┘       (Model + Msg → Effects + Updated Model)


┌─────────────┐
│   Effects   │  ◄──  Side effects (HTTP, storage, etc.)
└──────┬──────┘


┌─────────────┐
│   Runtime   │  ◄──  Executes effects automatically
└─────────────┘
1

Model holds state

Your application state is stored in a Model (like Ctx for context)
2

Actions trigger updates

User actions are dispatched as Action messages to the runtime
3

Update function returns effects

The model’s update() method processes messages and returns effects
4

Runtime executes effects

The runtime automatically handles effects (HTTP requests, storage, etc.)
5

Events flow back

Effects resolve to new messages, creating a unidirectional data flow

Use Cases

Use the complete Ctx model with the Runtime to build a full-featured Stremio application with user authentication, library management, streaming, and add-ons.
Use the types module to ensure your add-on uses the correct data structures and protocols when communicating with Stremio.
Pick and choose the models you need. For example, use just the Player model to add Stremio playback to your app.
Implement the Env trait for your platform to provide fetch and storage capabilities, then use the same core logic everywhere.

Platform Support

Stremio Core is designed to work across multiple platforms:
  • Native applications: Desktop (Windows, macOS, Linux) and mobile (iOS, Android)
  • WebAssembly: Browser-based applications
  • Servers: Backend services and APIs
When targeting WASM, do not enable the env-future-send feature as it requires the Send trait which is not supported in WASM environments.

Next Steps

Installation

Add Stremio Core to your project and configure features

Quickstart

Build your first Stremio Core application

Build docs developers (and LLMs) love