Go SDK, examples, and project templates for building WebAssembly components that run on wasmCloud v2.
component(go.wasmcloud.dev/component) — the component SDK: write HTTP handlers with standardnet/httptypes and compile them to WASI components with big Go via componentize-go. Two worlds are supported: a sync WASI P2 world (default, stock Go) and an async WASI P3 world (wasi:http@0.3.0, streaming bodies and native goroutine concurrency).component/nats— NATS-native messaging onwasmcloud:nats@0.1.0: core pub/sub and request-reply, JetStream, and JetStream KV, for what the portablecomponent/messagingpackage cannot express — acknowledged delivery and redelivery, replay from an arbitrary stream position, and compare-and-swap on a KV revision. Every function on the interface is async, so a component importing it targets WASI P3.examples/components— runnable example components, each a standalone Go module.templates— starter templates forwash new.x— experimental libraries.
See BUILDING.md for the exact versions of Go, componentize-go,
wit-bindgen and wash needed to build against a released SDK, and for how to
build with no network at all.
Each component/vX.Y.Z release
attaches component-vX.Y.Z.zip, the module zip that go get downloads, and
SHA256SUMS. Both carry Sigstore-signed SLSA build provenance. To verify a
download with the GitHub CLI:
gh attestation verify component-v0.1.6.zip \
--repo wasmCloud/go \
--signer-workflow wasmCloud/go/.github/workflows/release-tag.yaml--signer-workflow checks that the release workflow signed it, not just any
workflow in the repository. go itself checks every module download against
the Go checksum database.
SECURITY.md also covers the release
attestation and the go-airgap image.
wash new https://github.com/wasmCloud/go.git --name my-component \
--subfolder templates/http-hello-world
cd my-component
wash dev| Example | Shows | WASI P3 |
|---|---|---|
| http-server | HTTP routing and handlers via net/http |
|
| http-client | Outbound HTTP with http.RoundTripper |
|
| http-password-checker | A small JSON API | |
| http-keyvalue-crud | HTTP CRUD over host-served wasi:keyvalue |
|
| http-otel | OpenTelemetry tracing via the host's wasi:otel plugin |
|
| http-p3-streaming | Async WASI P3: streaming echo + concurrent outbound fan-out | ✅ |
| nats-request-reply | Core NATS request-reply: a responder plus an HTTP gateway that calls it | ✅ |
| nats-jetstream-orders | JetStream delivery into KV, with ack/nak and compare-and-swap | ✅ |
| nats-kv-watch | Watching a JetStream KV bucket and rebuilding derived state | ✅ |
| nats-stream-replay | JetStream replay by sequence or range, and a pull consumer you settle yourself | ✅ |
The unmarked examples build as sync WASI P2 components with stock Go. The
marked ones target the async P3 world: http-p3-streaming asks for it
directly, and the nats-* examples inherit it because every function on
wasmcloud:nats@0.1.0 is async. componentize-go selects a patched Go
toolchain for those automatically — see
http-p3-streaming.
wasmCloud v2 removed wadm manifests, capability providers, and the
wasmcloud:bus interface; the v1-era provider SDK
(go.wasmcloud.dev/provider) and TinyGo component SDK line (v0.0.x) are
no longer developed on main, though existing module versions
keep resolving. See MIGRATING.md.