Skip to main content
Version: v2.0.0-rc

Templates & Examples

Get started building components for wasmCloud.

  • Templates are scaffolds for new applications. Use wash new to create a project from a template, then customize it for your use case.
  • Examples are complete applications demonstrating specific wasmCloud capabilities.
Compatibility

All templates and examples on this page target wasmCloud v2 and require wash 2.0.0+. Components target the WASI 0.2 component model. Interface versions shown reflect what is pinned in each template or example at time of writing; wash new always pulls current source from the repository.

Templates

TemplateLanguageDescription
HTTP Hello WorldRustHTTP server using wstd
TCP ServiceRustHTTP API + TCP service workspace
HTTP Hello World (Hono)TypeScriptHTTP server using Hono
HTTP Hello World (Fetch API)TypeScriptHTTP server using the Fetch API
HTTP ClientTypeScriptOutgoing HTTP proxy
HTTP Service (Hono)TypeScriptFull REST API service
HTTP Service with Blob Storage (Hono)TypeScriptREST API + wasi:blobstore
HTTP Service with Key-Value Storage (Hono)TypeScriptREST API + wasi:keyvalue

Rust

Requires the Rust toolchain with the wasm32-wasip2 target. After scaffolding with wash new, run wash dev from the project directory to start the development loop. See Quickstart prerequisites for setup instructions.

HTTP Hello World

A minimal HTTP server component built with the wstd async runtime for Wasm components.

shell
wash new https://github.com/wasmCloud/wash.git --name my-project --subfolder templates/http-hello-world

TCP Service

A two-component Rust workspace. http-api is an HTTP server that accepts text input via a web UI and forwards it to service-leet, a TCP server that transforms text to "leet speak" (e.g., hello worldh3110 w0r1d). Together they demonstrate a multi-component service pattern with TCP transport.

shell
wash new https://github.com/wasmCloud/wash.git --name my-service --subfolder templates/service-tcp

TypeScript

Requires npm v14.17+ and TypeScript v5.6+. After scaffolding with wash new, run npm run dev from the project directory to start the development loop. See Quickstart prerequisites for setup instructions.

TypeScript templates use the @bytecodealliance/jco-std adapter for WASI compatibility and are available on the v2 branch of wasmCloud/typescript.

HTTP Hello World (Hono)

A minimal HTTP server component using the Hono web framework.

shell
wash new https://github.com/wasmCloud/typescript.git --name my-project --subfolder templates/http-hello-world-hono --git-ref v2

HTTP Hello World (Fetch API)

A minimal HTTP server component using the Service Worker Fetch API pattern.

shell
wash new https://github.com/wasmCloud/typescript.git --name my-project --subfolder templates/http-hello-world-fetch --git-ref v2

HTTP Client

An HTTP proxy component that makes outgoing HTTP requests. Supports GET, POST, PUT, DELETE, and PATCH with custom header forwarding, request body handling, JSON parsing, and response header extraction.

shell
wash new https://github.com/wasmCloud/typescript.git --name my-project --subfolder templates/http-client --git-ref v2

HTTP Service (Hono)

A full-featured HTTP service component using Hono, demonstrating middleware patterns including CORS, request logging, response timing, and request ID tracking, with RESTful CRUD endpoints and error handling.

shell
wash new https://github.com/wasmCloud/typescript.git --name my-project --subfolder templates/http-service-hono --git-ref v2

HTTP Service with Blob Storage (Hono)

An HTTP service component using Hono, backed by wasi:blobstore for persistent file storage. Provides a complete REST API for blob CRUD operations.

shell
wash new https://github.com/wasmCloud/typescript.git --name my-project --subfolder templates/http-blobstore-service-hono --git-ref v2

HTTP Service with Key-Value Storage (Hono)

An HTTP service component using Hono, backed by wasi:keyvalue for persistent key-value storage. Demonstrates CRUD operations, atomic incrementation, and Hono middleware patterns. When run with npm run dev, a NATS-KV key-value provider is automatically configured.

shell
wash new https://github.com/wasmCloud/typescript.git --name my-project --subfolder templates/http-kv-service-hono --git-ref v2

Examples

Complete example applications are available in the examples/ directory of wasmCloud/wash. Run wash dev from any example directory to build and start a local development environment.

ExampleLanguageOCI Artifact
HTTP Hello World (Rust)Rustghcr.io/wasmcloud/components/hello-world:0.1.0
BlobbyRust
QR Code GeneratorRust
HTTP Hello World (Go)Go

Rust

HTTP Hello World (Rust)

A simple HTTP server demonstrating how to handle HTTP requests using the wstd async runtime.

Blobby

A file server component ("Little Blobby Tables") demonstrating CRUD operations on blob storage, served through a web UI.

  • Source: wasmCloud/wash — examples/blobby
  • Interfaces: Imports wasi:blobstore/blobstore@0.2.0-draft, wasi:logging/logging@0.1.0-draft; exports wasi:http/incoming-handler@0.2.1

QR Code Generator

A QR code generator that accepts text input via HTTP and returns a PNG-encoded QR code, with a web UI.

Go

Requires Go 1.23+, TinyGo (latest), and wasm-tools v1.225.0. See Quickstart prerequisites for setup instructions.

HTTP Hello World (Go)

A simple HTTP server built in Go using github.com/julienschmidt/httprouter for routing and the go.wasmcloud.dev/component SDK for wasmCloud integration.