stateset-sdk
Start here. The Rust facade for StateSet iCommerce — one dependency, one prelude, feature-gated access to the commerce engine plus optional sync, crypto, policy, and macro surfaces.
If you're writing Rust against StateSet, add this crate rather than picking sibling crates by hand; it pins compatible versions of the whole set for you.
[]
= { = "1.23.3", = ["full"] }
Or: cargo add stateset-sdk --features full
Usage
use *;
#
Feature Flags
| Feature | Description | Default |
|---|---|---|
core |
Primitives + Core + DB + Embedded + Observability | Yes |
crypto |
VES v1.0 cryptographic operations | No |
policy |
Declarative policy engine | No |
macros |
Proc macros (StateSetId, GenerateDto, JsonSchema) |
No |
sync |
Outbox-driven sync engine and sequencer transport | No |
full |
Everything above | No |
Sync Runtime
With sync enabled, SyncRuntime and SyncRuntimeConfig bundle the sync engine,
sequencer HTTP transport, and runtime auth into a single surface: config loading,
sync operations, JSON-ready snapshots, kernel receipt queries, and
confirmation/dead-letter inspection. SyncRuntimeConfig loads from a file, a JSON
string, or the environment via from_file, from_json_str, and from_env.
What's Underneath
| Crate | Role |
|---|---|
stateset-embedded |
The engine — commerce operations over SQLite or PostgreSQL |
stateset-core |
Domain models, repository traits, validation, errors |
stateset-primitives |
Typed IDs, Money, CurrencyCode, Sku |
stateset-db |
SQLite and PostgreSQL implementations |
stateset-observability |
Metrics and tracing bootstrap |
stateset-crypto |
Canonical JSON, signing, hybrid PQ crypto |
stateset-policy |
Declarative rule engine |
stateset-sync |
Event-sourced outbox and sync engine |
Serving HTTP instead of embedding? See
stateset-http.
License
MIT OR Apache-2.0