Overview
Stremio Core is designed to be platform-agnostic, allowing you to build native applications for:- Desktop (Windows, macOS, Linux)
- Mobile (iOS, Android)
- Server-side applications
- CLI tools
Prerequisites
Minimum Rust Version: 1.77 (as specified in Cargo.toml)
Repository: github.com/Stremio/stremio-core
Repository: github.com/Stremio/stremio-core
Adding Dependencies
Add stremio-core to yourCargo.toml:
Features
Stremio Core supports several features:| Feature | Description |
|---|---|
derive | Exports the Model derive macro |
analytics | Enables analytics collection |
env-future-send | Adds Send bound to futures (required for native, incompatible with WASM) |
deflate | Enables deflate compression in official add-ons |
Implementing the Env Trait
You must implement theEnv trait for your platform:
Persistent Storage
For production applications, replace the in-memory storage with persistent storage:Creating and Using Models
Once you have the Env trait implemented, you can use Stremio’s models:Building Full Applications
For a complete native application, you’ll want to:1. Set Up Project Structure
2. Initialize on Startup
3. Handle Actions and Events
4. Persist State
Desktop UI Integration
Integrate with desktop UI frameworks:Mobile Integration
iOS
Usecargo-mobile2 or create a static library:
Android
Usecargo-ndk and JNI bindings:
Performance Considerations
Use Release Builds
Always use
--release for production. The debug build can be 10-100x slower.Enable LTO
Link-time optimization is enabled by default in stremio-core’s release profile.
Lazy Loading
Load data lazily to improve startup time. Don’t load everything at once.
Background Tasks
Use
exec_concurrent for background operations like analytics and caching.Testing
Next Steps
Environment Trait
Learn about all Env trait methods
Models
Explore available Stremio models
