vtx-sdk

Crates.iovtx-sdk
lib.rsvtx-sdk
version0.1.14
created_at2025-12-27 14:45:22.554402+00
updated_at2026-01-20 14:33:13.245351+00
descriptionOfficial SDK for developing VTX plugins using Rust and WebAssembly.
homepage
repositoryhttps://github.com/vtxdeo/vtx-sdk
max_upload_size
id2007371
size72,484
(Hellohistory)

documentation

https://docs.rs/vtx-sdk

README

vtx-sdk

Crates.io License

Official Rust SDK for developing VTX Project plugins.

vtx-sdk provides safe, idiomatic Rust bindings for the VTX Host ABI. It abstracts away the complexity of the WebAssembly Component Model (wit-bindgen), allowing plugin authors to focus on business logic rather than low-level bindings.

✨ Features

  • Type-Safe APIs
    Complete Rust wrappers for all WIT import interfaces (SQL, Stream I/O, FFmpeg, Context, Event Bus).

  • Low Boilerplate
    export_plugin! and VtxPlugin provide default implementations for common exports (migrations, resources, handle_event, authenticate).

  • Database Integration
    SQLite helpers with automatic JSON deserialization.

  • Helper Utilities
    ResponseBuilder, UserBuilder, BufferExt, VtxEventExt, and a unified VtxError model.

🏗️ Architecture

Unlike traditional Wasm projects, this SDK does not maintain a local copy of the WIT interface definitions. Instead, it relies on the vtx-protocol crate as the Single Source of Truth (SSOT).

  • Build Time
    The build.rs script dynamically retrieves the WIT definition path from the vtx-protocol build dependency and injects it into the compilation process.

  • Runtime / Metadata
    The WIT_DEFINITION constant is also sourced directly from the protocol crate, ensuring zero divergence between the SDK and the protocol.

📦 Installation

Add vtx-sdk to your plugin’s Cargo.toml:

[dependencies]
vtx-sdk = "0.1.8"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
anyhow = "1.0"

[lib]
crate-type = ["cdylib"] # Required for compiling to Wasm
Commit count: 43

cargo fmt