Skip to main content
Version: v2.8.1


The runtime is a library that provides utility methods for your application. There is both a Go and JavaScript runtime and the aim is to try and keep them at parity where possible.

It has utility methods for:

The Go Runtime is available through importing All methods in this package take a context as the first parameter. This context should be obtained from the OnStartup or OnDomReady hooks.


Whilst the context will be provided to the OnStartup method, there's no guarantee the runtime will work in this method as the window is initialising in a different thread. If you wish to call runtime methods at startup, use OnDomReady.

The JavaScript library is available to the frontend via the window.runtime map. There is a runtime package generated when using dev mode that provides TypeScript declarations for the runtime. This should be located in the wailsjs directory in your frontend directory.


Go: Hide(ctx context.Context)
JS: Hide()

Hides the application.


On Mac, this will hide the application in the same way as the Hide menu item in standard Mac applications. This is different to hiding the window, but the application still being in the foreground. For Windows and Linux, this is currently the same as WindowHide.


Shows the application.


On Mac, this will bring the application back into the foreground. For Windows and Linux, this is currently the same as WindowShow.

Go: Show(ctx context.Context)
JS: Show()


Quits the application.

Go: Quit(ctx context.Context)
JS: Quit()


Returns details of the current environment.

Go: Environment(ctx context.Context) EnvironmentInfo
JS: Environment(): Promise<EnvironmentInfo>



type EnvironmentInfo struct {
BuildType string
Platform string
Arch string


interface EnvironmentInfo {
buildType: string;
platform: string;
arch: string;