Skip to main content

Requirements

Minimum Supported Rust Version (MSRV): 1.77When upgrading the MSRV, make sure to update the CI workflows accordingly.
Ensure you have Rust 1.77 or later installed:
rustc --version
If you need to update Rust:
rustup update

Add to Your Project

Add stremio-core to your Cargo.toml:
Cargo.toml
[dependencies]
stremio-core = "0.1.0"

Using a Specific Git Commit

To use the latest development version:
Cargo.toml
[dependencies]
stremio-core = { git = "https://github.com/Stremio/stremio-core", branch = "main" }

Feature Flags

Stremio Core provides several optional feature flags to customize functionality:

env-future-send

Adds the Send marker trait to the Env trait methods and EnvFuture.
Cargo.toml
[dependencies]
stremio-core = { version = "0.1.0", features = ["env-future-send"] }
Do NOT enable this feature for WebAssembly targets!The Send trait is not supported in WASM environments. Enabling this feature for WASM will cause a compile error. See wasm-bindgen issue #2833 for details.
When to use:
[dependencies]
stremio-core = { version = "0.1.0", features = ["env-future-send"] }

derive

Exports the Model derive macro from stremio-derive.
Cargo.toml
[dependencies]
stremio-core = { version = "0.1.0", features = ["derive"] }
With this feature enabled, you can derive the Model trait:
use stremio_core::Model;

#[derive(Model, Clone)]
struct MyModel {
    // your fields
}
Without the derive feature, you’ll need to manually implement the Model trait or depend on stremio-derive separately.

analytics

Enables core analytics functionality.
Cargo.toml
[dependencies]
stremio-core = { version = "0.1.0", features = ["analytics"] }
When enabled, this feature:
  • Adds the analytics module to the public API
  • Enables analytics tracking in the runtime
  • Provides Env::analytics_context() and Env::flush_analytics() methods

deflate

Enables deflate compression in official add-ons.
Cargo.toml
[dependencies]
stremio-core = { version = "0.1.0", features = ["deflate"] }
This feature is useful when you need compressed responses from official Stremio add-ons to reduce bandwidth.

Multiple Features

You can combine multiple features:
Cargo.toml
[dependencies]
stremio-core = { 
    version = "0.1.0", 
    features = ["env-future-send", "derive", "analytics", "deflate"] 
}

Platform-Specific Configuration

Depending on your target platform, you may need different configurations:
Cargo.toml
[dependencies]
stremio-core = { version = "0.1.0", features = ["env-future-send", "derive", "analytics"] }

# Common desktop dependencies
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"

Verify Installation

Create a simple test to verify the installation:
src/main.rs
use stremio_core::types::profile::Profile;

fn main() {
    let profile = Profile::default();
    println!("Profile created: {:#?}", profile);
}
Run the example:
cargo run
You should see output showing the default profile structure.

Development Tools

For development, you may also want these tools:
# Install rustfmt for code formatting
rustup component add rustfmt

# Install clippy for linting
rustup component add clippy
The Stremio Core repository includes configuration files:
  • rustfmt.toml - Code formatting rules
  • clippy.toml - Linting rules
Run formatting and linting:
cargo fmt
cargo clippy

Release Configuration

The default release profile in Stremio Core is optimized for size:
Cargo.toml
[profile.release]
lto = true
opt-level = 's'
  • lto = true: Enables Link Time Optimization for better dead code elimination
  • opt-level = 's': Optimizes for size rather than speed
You can override this in your own Cargo.toml if needed:
Cargo.toml
[profile.release]
lto = true
opt-level = 3  # Optimize for speed instead

Troubleshooting

Error: Send is not implemented for a type when building for WASM.Solution: Remove the env-future-send feature from your dependencies:
[dependencies]
stremio-core = { version = "0.1.0" }  # No features
Error: Compilation fails with older Rust versions.Solution: Update Rust to version 1.77 or later:
rustup update
Error: cannot find derive macro Model in this scopeSolution: Enable the derive feature:
[dependencies]
stremio-core = { version = "0.1.0", features = ["derive"] }

Next Steps

Quickstart Guide

Learn how to build your first application with Stremio Core

Build docs developers (and LLMs) love