Build a Go backend module
Compile Go source with TinyGo and the BlinkHost SDK 1.0 host contract.
Last updated 2026-08-07
What you'll achieve
- Write a backend handler in Go
- Call named platform capabilities
- Promote one verified Wasm artifact
Create the module
Open Backend, choose Create module, select Go (TinyGo), and enter a unique name. The generated source uses the managed TinyGo 0.41 pipeline and BlinkHost SDK 1.0.
package main
import "blinkhost.dev/sdk/go/blinkhost"
func main() {
response, err := blinkhost.JSONResponse(200, map[string]string{"message": "Hello from BlinkHost Go"})
if err != nil || blinkhost.Respond(response) != nil {
panic("BlinkHost response write failed")
}
}
Expected result: the module returns status 200 and {"message":"Hello from BlinkHost Go"}.
Runtime contract
The SDK reads request metadata and bodies, writes structured responses, accesses named database bindings, retrieves permitted secrets, hashes passwords through the host, performs policy-bound outbound requests, and emits bounded structured logs.
Build and verify
Choose Build. BlinkHost snapshots the source identity, compiles without network access, validates the Wasm contract, and signs accepted output. Select Use artifact, deploy, and compare the selected digest with the deployment record.
TinyGo is not identical to the full Go runtime. Validate library compatibility and memory behavior before depending on a package.
Help improve this page
Sign in to send page-specific feedback. For account-specific help, email support@blinkhost.me.