WAM (Web App Module) is a browser UI loaded by a Channel client. The Go SDK returns the action that opens the UI; the UI itself uses the shared TypeScript/React package @channel.io/app-sdk-wam.
For a command handler:
func openTutorial(appID string) appsdk.TypedHandlerFunc[
command.ExecuteRequest,
command.ActionResult,
] {
return func(
_ context.Context,
fnCtx appsdk.Context,
input *command.ExecuteRequest,
) (*command.ActionResult, error) {
attributes, err := structpb.NewStruct(map[string]any{
"appId": appID,
"name": "tutorial",
"wamArgs": map[string]any{
"view": "summary",
},
})
if err != nil {
return nil, err
}
return &command.ActionResult{Type: "wam", Attributes: attributes}, nil
}
}The action contains a public App ID, WAM name, and minimal client-readable arguments. Never include a secret, access token, provider credential, or raw customer record in wamArgs.
Register the WAM Endpoint root, for example:
https://app.example.com/resource/wam
Serve the built SPA at ${WAM_ENDPOINT}/${name}, such as /resource/wam/tutorial. The Go Function route and WAM static route are separate; mount the WAM directory explicitly on the selected HTTP server.
Wrap the UI with WamProvider and use public hooks:
useWamData/useTypedWamDatafor host context andwamArgs;useCallFunctionfor calls back to the Go app server;useNativeFunctionfor Channel operations authorized as the current manager/user;useWamSizeanduseWamClosefor host UI control.
See the language-neutral WAM SDK reference for the hook API.
- App/bot work: WAM calls a Go Function with
useCallFunction; the handler obtains a channel token fromnative.TokenManager. - Manager/user work: WAM calls
useNativeFunction; the Channel host supplies and evaluates current-user authorization.
The Go server never sends App Secret, Signing Key, app token, or channel token to the WAM, and it does not mint manager/user authorization.
A browser opened directly at the WAM URL does not provide the Channel host bridge. Test loading, runtime data, app Function calls, native Function calls, permission failures, resize, and close behavior inside an installed private app.
For a complete implementation, see the Go tutorial.