Expand description
SDK for implementing makeshop guest extensions in Rust.
A guest implements exactly one entrypoint. Enable the Cargo feature for that entrypoint and
annotate its function with hook or event; the attribute generates the component
wiring. Enabling several entrypoint features at once fails to build, because their host
imports would be mixed into one component.
The package is named makeshop-extensions-sdk and is imported as makeshop_extensions.
§Hooks and events
A hook interrupts the surrounding operation: it runs synchronously, and the value it returns decides what happens next. An event is a delivery: a failed handler is retried, and a handler that gives up sends the delivery to dead-letter, so an event handler must be idempotent. Annotating an entrypoint with the wrong attribute is a compile error that names the other one.
§Contract versions
The -vN suffix of an entrypoint feature is the major version of its contract, which moves
independently of the crate version. A contract is not rewritten in place: a new major arrives
as an additional feature, so migrating changes one line in Cargo.toml. There is no
unsuffixed alias meaning “the latest contract”, so a rebuild alone never changes the contract
a guest is built against.
§Host APIs and tests
host provides connector calls, execution context, UUID generation, and runtime logging as
canonical SDK types rather than per-entrypoint bindings, so guest code reads the same across
entrypoints. Endpoints, credentials, retries, and default headers come from the deployment
configuration; a guest names a connector and builds a body.
The attributes expand to component wiring only for wasm32 targets, so in a native build an
entrypoint stays an ordinary function that cargo test can call. testing provides the
harness that supplies connector responses, an execution context, and log capture.
Re-exports§
pub use content_blocks;
Modules§
- finalize_
checkout_ validation - Input and output types and helpers for the
finalize_checkout_validationhook. - host
- Host APIs provided by the runtime.
- order_
completed - Input and output types and helpers for the
order_completedevent. - order_
completed_ content - Input and output types for the
order_completed_contenthook. - testing
- APIs for unit-testing guest extensions.