Go bindings covering all Steamworks API interface families, with typed wrappers for implemented methods and purego/ffi handles for the remaining surfaces.
Warning
32-bit OSes are not supported.
164
Note
If newer Steamworks SDK releases add or update symbols that are not yet in these bindings, use the raw symbol access method to call them directly.
Before using this library, make sure Steam's redistributable binaries are available on your runtime machine. This repository no longer ships the precompiled Steamworks shared libraries; provide them alongside your application at runtime (for example, next to your executable).
Common locations and filenames:
- Linux (64-bit):
libsteam_api.so - macOS:
libsteam_api.dylib - Windows (64-bit):
steam_api64.dll
On Windows, copy the DLL into the working directory:
steam_api64.dll(copy fromredistribution_bin\\win64\\steam_api64.dllin the SDK)
For local development, ensure steam_appid.txt is available next to the
executable (or run Steam with your app ID configured).
The Steamworks client must be running and the API must be initialized before
calling most interfaces. Load is optional, but allows you to surface missing
redistributables early.
package main
import (
"fmt"
"log"
"os"
"github.com/badhex/go-steamworks"
)
const appID = 480 // Replace with your own App ID.
func main() {
if steamworks.RestartAppIfNecessary(appID) {
os.Exit(0)
}
if err := steamworks.Load(); err != nil {
log.Fatalf("failed to load steamworks: %v", err)
}
if err := steamworks.Init(); err != nil {
log.Fatalf("steamworks.Init failed: %v", err)
}
fmt.Printf("SteamID: %v\n", steamworks.SteamUser().GetSteamID())
}Steamworks expects you to poll callbacks regularly on your main thread.
for running {
steamworks.RunCallbacks()
// ...your game loop...
}package steamapi
import (
"github.com/badhex/go-steamworks"
"golang.org/x/text/language"
)
func SystemLang() language.Tag {
switch steamworks.SteamApps().GetCurrentGameLanguage() {
case "english":
return language.English
case "japanese":
return language.Japanese
}
return language.Und
}if achieved, ok := steamworks.SteamUserStats().GetAchievement("FIRST_WIN"); ok && !achieved {
steamworks.SteamUserStats().SetAchievement("FIRST_WIN")
steamworks.SteamUserStats().StoreStats()
}call := steamworks.SteamHTTP().CreateHTTPRequest(steamworks.EHTTPMethodGET, "https://example.com")
callHandle, ok := steamworks.SteamHTTP().SendHTTPRequest(call)
if !ok {
// handle request creation failure
}
type HTTPRequestCompleted struct {
Request steamworks.HTTPRequestHandle
Context uint64
Status int32
}
// Define the struct to mirror the Steamworks callback payload you expect.
// Use the SDK's callback ID for the expected payload.
result := steamworks.NewCallResult[HTTPRequestCompleted](callHandle, 2101)
if _, failed, err := result.Wait(context.Background(), 0); err == nil && !failed {
// process response
}This repository ships typed helpers for async call results and manual callback dispatch, plus additional interface accessors to align with common Steamworks flows.
- Use
NewCallResultto await async call results with typed payloads. - Use
NewCallbackDispatcher+RegisterCallbackfor manual callback registration and dispatch. - Use versioned accessors such as
SteamAppsV008()when you need explicit interface versions.
By default, the package expects Steam redistributables to be available on the runtime library path. You can also opt into embedding redistributables with a build tag:
- Runtime loading (default): rely on
libsteam_api.so/libsteam_api.dylibbeing in the dynamic linker path or alongside your executable. - Embedded loading: build with
-tags steamworks_embeddedto embed the SDK redistributables and load them from a temporary file at runtime.
Use STEAMWORKS_LIB_PATH to point at a custom shared library location when
runtime loading.
gen.go— code generator for parsing the SDK and building bindings.examples/— runnable samples for common startup flows.
The package now exposes all Steamworks API interface families through friendly Go accessors. Interfaces are either:
- fully/partially typed wrappers (method-by-method Go bindings), or
- handle-backed wrappers exposing native Go structs with
Ptr() uintptrandValid() bool.
General
RestartAppIfNecessary(appID uint32) boolInit() errorRunCallbacks()Shutdown()IsSteamRunning() boolGetSteamInstallPath() stringReleaseCurrentThreadMemory()
ISteamApps (SteamApps() ISteamApps) — typed wrappers
BGetDLCDataByIndex(iDLC int) (appID AppId_t, available bool, name string, success bool)BIsSubscribed() boolBIsLowViolence() boolBIsCybercafe() boolBIsVACBanned() boolBIsDlcInstalled(appID AppId_t) boolBIsSubscribedApp(appID AppId_t) boolBIsSubscribedFromFreeWeekend() boolBIsSubscribedFromFamilySharing() boolBIsTimedTrial() (allowedSeconds, playedSeconds uint32, ok bool)BIsAppInstalled(appID AppId_t) boolGetAvailableGameLanguages() stringGetEarliestPurchaseUnixTime(appID AppId_t) uint32GetAppInstallDir(appID AppId_t) stringGetCurrentGameLanguage() stringGetDLCCount() int32GetCurrentBetaName() (string, bool)GetInstalledDepots(appID AppId_t) []DepotId_tGetAppOwner() CSteamIDGetLaunchQueryParam(key string) stringGetDlcDownloadProgress(appID AppId_t) (downloaded, total uint64, ok bool)GetAppBuildId() int32GetFileDetails(filename string) SteamAPICall_tGetLaunchCommandLine(bufferSize int) stringGetNumBetas() (total int, available int, private int)GetBetaInfo(index int) (flags uint32, buildID uint32, lastUpdated uint32, name string, description string, ok bool)InstallDLC(appID AppId_t)UninstallDLC(appID AppId_t)RequestAppProofOfPurchaseKey(appID AppId_t)RequestAllProofOfPurchaseKeys()MarkContentCorrupt(missingFilesOnly bool) boolSetDlcContext(appID AppId_t) boolSetActiveBeta(name string) bool
ISteamAppTicket (SteamAppTicket() ISteamAppTicket) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool. BSessionRemotePlayTogether(sessionID uint32) boolGetSessionGuestID(sessionID uint32) CSteamIDGetSmallSessionAvatar(sessionID uint32) int32GetMediumSessionAvatar(sessionID uint32) int32GetLargeSessionAvatar(sessionID uint32) int32
ISteamClient (SteamClient() ISteamClient) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool.
ISteamController (SteamController() ISteamController) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool.
ISteamFriends (SteamFriends() ISteamFriends) — typed wrappers
GetPersonaName() stringGetPersonaState() EPersonaStateGetFriendCount(flags EFriendFlags) intGetFriendByIndex(index int, flags EFriendFlags) CSteamIDGetFriendRelationship(friend CSteamID) EFriendRelationshipGetFriendPersonaState(friend CSteamID) EPersonaStateGetFriendPersonaName(friend CSteamID) stringGetFriendPersonaNameHistory(friend CSteamID, index int) stringGetFriendSteamLevel(friend CSteamID) intGetSmallFriendAvatar(friend CSteamID) int32GetMediumFriendAvatar(friend CSteamID) int32GetLargeFriendAvatar(friend CSteamID) int32SetRichPresence(key, value string) boolGetFriendGamePlayed(friend CSteamID) (FriendGameInfo, bool)- Returns
FriendGameInfomapped from SDKFriendGameInfo_t(see field breakdown below).
- Returns
InviteUserToGame(friend CSteamID, connectString string) boolActivateGameOverlay(dialog string)ActivateGameOverlayToUser(dialog string, steamID CSteamID)ActivateGameOverlayToWebPage(url string, mode EActivateGameOverlayToWebPageMode)ActivateGameOverlayToStore(appID AppId_t, flag EOverlayToStoreFlag)ActivateGameOverlayInviteDialog(lobbyID CSteamID)ActivateGameOverlayInviteDialogConnectString(connectString string)
Returned structure details:
FriendGameInfo(SDKFriendGameInfo_t) fields:GameID CGameIDGameIP uint32GamePort uint16QueryPort uint16LobbySteamID CSteamID
ISteamGameCoordinator (SteamGameCoordinator() ISteamGameCoordinator) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool.
ISteamGameServer (SteamGameServer() ISteamGameServer) — typed wrappers
AssociateWithClan(clanID CSteamID) SteamAPICall_tBeginAuthSession(authTicket []byte, steamID CSteamID) EBeginAuthSessionResultBLoggedOn() boolBSecure() boolBUpdateUserData(steamIDUser CSteamID, playerName string, score uint32) boolCancelAuthTicket(authTicket HAuthTicket)ClearAllKeyValues()ComputeNewPlayerCompatibility(steamIDNewPlayer CSteamID, steamIDPlayers []CSteamID, steamIDPlayersInGame []CSteamID, steamIDTeamPlayers []CSteamID) SteamAPICall_tCreateUnauthenticatedUserConnection() CSteamIDEnableHeartbeats(active bool)EndAuthSession(steamID CSteamID)ForceHeartbeat()GetAuthSessionTicket(authTicket []byte) (ticket HAuthTicket, size uint32)GetGameplayStats()GetNextOutgoingPacket(dest []byte) (size int32, ip uint32, port uint16)GetPublicIP() uint32GetServerReputation() SteamAPICall_tGetSteamID() CSteamIDHandleIncomingPacket(data []byte, ip uint32, port uint16) boolInitGameServer(ip uint32, steamPort uint16, gamePort uint16, queryPort uint16, serverMode uint32, versionString string) boolLogOff()LogOn(token string)LogOnAnonymous()RequestUserGroupStatus(steamIDUser CSteamID, steamIDGroup CSteamID) boolSendUserConnectAndAuthenticate(ipClient uint32, authBlob []byte) (steamIDUser CSteamID, ok bool)SendUserDisconnect(steamIDUser CSteamID)SetBotPlayerCount(botPlayers int32)SetDedicatedServer(dedicated bool)SetGameData(gameData string)SetGameDescription(description string)SetGameTags(gameTags string)SetHeartbeatInterval(interval int)SetKeyValue(key string, value string)SetMapName(mapName string)SetMaxPlayerCount(playersMax int32)SetModDir(modDir string)SetPasswordProtected(passwordProtected bool)SetProduct(product string)SetRegion(region string)SetServerName(serverName string)SetSpectatorPort(spectatorPort uint16)SetSpectatorServerName(spectatorServerName string)UserHasLicenseForApp(steamID CSteamID, appID AppId_t) EUserHasLicenseForAppResultWasRestartRequested() bool
ISteamGameServerStats (SteamGameServerStats() ISteamGameServerStats) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool.
ISteamHTMLSurface (SteamHTMLSurface() ISteamHTMLSurface) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool.
ISteamHTTP (SteamHTTP() ISteamHTTP) — typed wrappers
CreateHTTPRequest(method EHTTPMethod, absoluteURL string) HTTPRequestHandleSetHTTPRequestHeaderValue(request HTTPRequestHandle, headerName, headerValue string) boolSendHTTPRequest(request HTTPRequestHandle) (SteamAPICall_t, bool)GetHTTPResponseBodySize(request HTTPRequestHandle) (uint32, bool)GetHTTPResponseBodyData(request HTTPRequestHandle, buffer []byte) boolReleaseHTTPRequest(request HTTPRequestHandle) bool
ISteamInput (SteamInput() ISteamInput) — typed wrappers
GetConnectedControllers() []InputHandle_tGetInputTypeForHandle(inputHandle InputHandle_t) ESteamInputTypeInit(bExplicitlyCallRunFrame bool) boolShutdown()RunFrame()EnableDeviceCallbacks()GetActionSetHandle(actionSetName string) InputActionSetHandle_tActivateActionSet(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t)GetCurrentActionSet(inputHandle InputHandle_t) InputActionSetHandle_tActivateActionSetLayer(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t)DeactivateActionSetLayer(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t)DeactivateAllActionSetLayers(inputHandle InputHandle_t)GetActiveActionSetLayers(inputHandle InputHandle_t, handles []InputActionSetHandle_t) intGetDigitalActionHandle(actionName string) InputDigitalActionHandle_tGetDigitalActionData(inputHandle InputHandle_t, actionHandle InputDigitalActionHandle_t) InputDigitalActionData- Returns
InputDigitalActionDatamapped from SDKInputDigitalActionData_t.
- Returns
GetDigitalActionOrigins(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t, actionHandle InputDigitalActionHandle_t, origins []EInputActionOrigin) intGetAnalogActionHandle(actionName string) InputAnalogActionHandle_tGetAnalogActionData(inputHandle InputHandle_t, actionHandle InputAnalogActionHandle_t) InputAnalogActionData- Returns
InputAnalogActionDatamapped from SDKInputAnalogActionData_t.
- Returns
GetAnalogActionOrigins(inputHandle InputHandle_t, actionSetHandle InputActionSetHandle_t, actionHandle InputAnalogActionHandle_t, origins []EInputActionOrigin) intStopAnalogActionMomentum(inputHandle InputHandle_t, actionHandle InputAnalogActionHandle_t)GetMotionData(inputHandle InputHandle_t) InputMotionData- Returns
InputMotionDatamapped from SDKInputMotionData_t.
- Returns
TriggerVibration(inputHandle InputHandle_t, leftSpeed, rightSpeed uint16)TriggerVibrationExtended(inputHandle InputHandle_t, leftSpeed, rightSpeed, leftTriggerSpeed, rightTriggerSpeed uint16)TriggerSimpleHapticEvent(inputHandle InputHandle_t, pad ESteamControllerPad, durationMicroSec, offMicroSec, repeat uint16)SetLEDColor(inputHandle InputHandle_t, red, green, blue uint8, flags ESteamInputLEDFlag)ShowBindingPanel(inputHandle InputHandle_t) boolGetControllerForGamepadIndex(index int) InputHandle_tGetGamepadIndexForController(inputHandle InputHandle_t) intGetStringForActionOrigin(origin EInputActionOrigin) stringGetGlyphForActionOrigin(origin EInputActionOrigin) stringGetRemotePlaySessionID(inputHandle InputHandle_t) uint32
Returned structure details:
InputDigitalActionData(SDKInputDigitalActionData_t) fields:State boolActive bool
InputAnalogActionData(SDKInputAnalogActionData_t) fields:Mode EInputSourceModeX float32Y float32Active bool
InputMotionData(SDKInputMotionData_t) fields:RotQuatX float32,RotQuatY float32,RotQuatZ float32,RotQuatW float32PosAccelX float32,PosAccelY float32,PosAccelZ float32RotVelX float32,RotVelY float32,RotVelZ float32
ISteamInventory (SteamInventory() ISteamInventory) — typed wrappers
GetResultStatus(result SteamInventoryResult_t) EResultGetResultItems(result SteamInventoryResult_t, outItems []SteamItemDetails) (int, bool)- Populates
outItemswithSteamItemDetailsentries mapped from SDKSteamItemDetails_t.
- Populates
DestroyResult(result SteamInventoryResult_t)
Returned structure details:
SteamItemDetails(SDKSteamItemDetails_t) fields:ItemID SteamItemInstanceID_tDefinition SteamItemDef_tQuantity uint16Flags uint16
ISteamMatchmaking (SteamMatchmaking() ISteamMatchmaking) — typed wrappers
GetFavoriteGameCount() intGetFavoriteGame(index int) (FavoriteGame, bool)AddFavoriteGame(appID AppId_t, ip uint32, connectionPort, queryPort uint16, flags, lastPlayedOnServerTime uint32) intRemoveFavoriteGame(appID AppId_t, ip uint32, connectionPort, queryPort uint16, flags uint32) boolRequestLobbyList() SteamAPICall_tAddRequestLobbyListStringFilter(key, value string, comparisonType ELobbyComparison)AddRequestLobbyListNumericalFilter(key string, value int, comparisonType ELobbyComparison)AddRequestLobbyListNearValueFilter(key string, value int)AddRequestLobbyListFilterSlotsAvailable(slotsAvailable int)AddRequestLobbyListDistanceFilter(distanceFilter ELobbyDistanceFilter)AddRequestLobbyListResultCountFilter(maxResults int)AddRequestLobbyListCompatibleMembersFilter(lobbyID CSteamID)GetLobbyByIndex(index int) CSteamIDCreateLobby(lobbyType ELobbyType, maxMembers int) SteamAPICall_tJoinLobby(lobbyID CSteamID) SteamAPICall_tLeaveLobby(lobbyID CSteamID)InviteUserToLobby(lobbyID, invitee CSteamID) boolSetLobbyMemberLimit(lobbyID CSteamID, maxMembers int) boolGetLobbyMemberLimit(lobbyID CSteamID) intSetLobbyType(lobbyID CSteamID, lobbyType ELobbyType) boolSetLobbyJoinable(lobbyID CSteamID, joinable bool) boolGetLobbyOwner(lobbyID CSteamID) CSteamIDSetLobbyOwner(lobbyID, owner CSteamID) boolSetLinkedLobby(lobbyID, lobbyDependent CSteamID) boolGetNumLobbyMembers(lobbyID CSteamID) intGetLobbyMemberByIndex(lobbyID CSteamID, memberIndex int) CSteamIDSetLobbyData(lobbyID CSteamID, key, value string) boolGetLobbyData(lobbyID CSteamID, key string) stringDeleteLobbyData(lobbyID CSteamID, key string) boolGetLobbyDataCount(lobbyID CSteamID) intGetLobbyDataByIndex(lobbyID CSteamID, lobbyDataIndex int) (key, value string, ok bool)SetLobbyMemberData(lobbyID CSteamID, key, value string)GetLobbyMemberData(lobbyID, user CSteamID, key string) stringSendLobbyChatMsg(lobbyID CSteamID, msgBody []byte) boolGetLobbyChatEntry(lobbyID CSteamID, chatID int, data []byte) (user CSteamID, entryType EChatEntryType, bytesCopied int)RequestLobbyData(lobbyID CSteamID) boolSetLobbyGameServer(lobbyID CSteamID, ip uint32, port uint16, server CSteamID)GetLobbyGameServer(lobbyID CSteamID) (ip uint32, port uint16, server CSteamID, ok bool)CheckForPSNGameBootInvite(lobbyID *CSteamID) bool
ISteamMatchmakingServers (SteamMatchmakingServers() ISteamMatchmakingServers) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool. RequestFavoritesServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequestRequestFriendsServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequestRequestHistoryServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequestRequestInternetServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequestRequestLANServerList(appID AppId_t, response uintptr) HServerListRequestRequestSpectatorServerList(appID AppId_t, filters []uintptr, response uintptr) HServerListRequestReleaseRequest(request HServerListRequest)GetServerDetails(request HServerListRequest, server int) uintptrCancelQuery(request HServerListRequest)RefreshQuery(request HServerListRequest)IsRefreshing(request HServerListRequest) boolGetServerCount(request HServerListRequest) intRefreshServer(request HServerListRequest, server int)PingServer(ip uint32, port uint16, response uintptr) HServerQueryPlayerDetails(ip uint32, port uint16, response uintptr) HServerQueryServerRules(ip uint32, port uint16, response uintptr) HServerQueryCancelServerQuery(query HServerQuery)
ISteamMusic (SteamMusic() ISteamMusic) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool.
ISteamNetworking (SteamNetworking() ISteamNetworking) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool.
ISteamNetworkingMessages (SteamNetworkingMessages() ISteamNetworkingMessages) — typed wrappers
SendMessageToUser(identity *SteamNetworkingIdentity, data []byte, sendFlags SteamNetworkingSendFlags, remoteChannel int) EResultReceiveMessagesOnChannel(channel int, maxMessages int) []*SteamNetworkingMessage- Returns a slice of
*SteamNetworkingMessagewrappers over SDKSteamNetworkingMessage_t.
- Returns a slice of
AcceptSessionWithUser(identity *SteamNetworkingIdentity) boolCloseSessionWithUser(identity *SteamNetworkingIdentity) boolCloseChannelWithUser(identity *SteamNetworkingIdentity, channel int) bool
Returned structure details:
SteamNetworkingIdentityfields:IdentityType int32Reserved [3]int32Data [128]byte
SteamNetworkingMessage(SDKSteamNetworkingMessage_t) pointer wrapper:Data uintptrSize int32Conn HSteamNetConnectionIdentityPeer SteamNetworkingIdentityConnUserData int64TimeReceived int64MessageNumber int64ReleaseFunc uintptr(invoked byRelease())
ISteamNetworkingSockets (SteamNetworkingSockets() ISteamNetworkingSockets) — typed wrappers
CreateListenSocketIP(localAddress *SteamNetworkingIPAddr, options []SteamNetworkingConfigValue) HSteamListenSocketCreateListenSocketP2P(localVirtualPort int, options []SteamNetworkingConfigValue) HSteamListenSocketConnectByIPAddress(address *SteamNetworkingIPAddr, options []SteamNetworkingConfigValue) HSteamNetConnectionConnectP2P(identity *SteamNetworkingIdentity, remoteVirtualPort int, options []SteamNetworkingConfigValue) HSteamNetConnectionAcceptConnection(connection HSteamNetConnection) EResultCloseConnection(connection HSteamNetConnection, reason int, debug string, enableLinger bool) boolCloseListenSocket(socket HSteamListenSocket) boolSendMessageToConnection(connection HSteamNetConnection, data []byte, sendFlags SteamNetworkingSendFlags) (EResult, int64)ReceiveMessagesOnConnection(connection HSteamNetConnection, maxMessages int) []*SteamNetworkingMessage- Returns a slice of
*SteamNetworkingMessagewrappers over SDKSteamNetworkingMessage_t.
- Returns a slice of
CreatePollGroup() HSteamNetPollGroupDestroyPollGroup(group HSteamNetPollGroup) boolSetConnectionPollGroup(connection HSteamNetConnection, group HSteamNetPollGroup) boolReceiveMessagesOnPollGroup(group HSteamNetPollGroup, maxMessages int) []*SteamNetworkingMessage- Returns a slice of
*SteamNetworkingMessagewrappers over SDKSteamNetworkingMessage_t.
- Returns a slice of
Returned structure details:
SteamNetworkingIPAddrfields:IP [16]bytePort uint16
SteamNetworkingIdentityfields:IdentityType int32Reserved [3]int32Data [128]byte
SteamNetworkingMessage(SDKSteamNetworkingMessage_t) pointer wrapper:Data uintptrSize int32Conn HSteamNetConnectionIdentityPeer SteamNetworkingIdentityConnUserData int64TimeReceived int64MessageNumber int64ReleaseFunc uintptr(invoked byRelease())
ISteamNetworkingUtils (SteamNetworkingUtils() ISteamNetworkingUtils) — typed wrappers
AllocateMessage(size int) *SteamNetworkingMessage- Returns a
*SteamNetworkingMessagewrapper over SDKSteamNetworkingMessage_t.
- Returns a
InitRelayNetworkAccess()GetLocalTimestamp() SteamNetworkingMicroseconds
ISteamRemotePlay (SteamRemotePlay() ISteamRemotePlay) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool. BSessionRemotePlayTogether(sessionID uint32) boolGetSessionGuestID(sessionID uint32) uint32GetSmallSessionAvatar(sessionID uint32) int32GetMediumSessionAvatar(sessionID uint32) int32GetLargeSessionAvatar(sessionID uint32) int32
ISteamRemoteStorage (SteamRemoteStorage() ISteamRemoteStorage) — typed wrappers
FileWrite(file string, data []byte) boolFileRead(file string, data []byte) int32FileDelete(file string) boolGetFileSize(file string) int32
ISteamScreenshots (SteamScreenshots() ISteamScreenshots) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool.
ISteamTimeline (SteamTimeline() ISteamTimeline) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool.
ISteamUGC (SteamUGC() ISteamUGC) — typed wrappers
GetNumSubscribedItems(includeLocallyDisabled bool) uint32GetSubscribedItems(includeLocallyDisabled bool) []PublishedFileId_tMarkDownloadedItemAsUnused(publishedFileID PublishedFileId_t) boolGetNumDownloadedItems() uint32GetDownloadedItems() []PublishedFileId_t
ISteamUser (SteamUser() ISteamUser) — typed wrappers
AdvertiseGame(gameServerSteamID CSteamID, ip uint32, port uint16)BeginAuthSession(authTicket []byte, steamID CSteamID) EBeginAuthSessionResultBIsBehindNAT() boolBIsPhoneIdentifying() boolBIsPhoneRequiringVerification() boolBIsPhoneVerified() boolBIsTwoFactorEnabled() boolBLoggedOn() boolBSetDurationControlOnlineState(newState EDurationControlOnlineState) boolCancelAuthTicket(authTicket HAuthTicket)DecompressVoice(compressedData []byte, destBuffer []byte, desiredSampleRate uint32) (bytesWritten uint32, result EVoiceResult)EndAuthSession(steamID CSteamID)GetAuthSessionTicket(authTicket []byte, identityRemote *SteamNetworkingIdentity) (ticket HAuthTicket, size uint32)GetAuthTicketForWebApi(identity string) HAuthTicketGetAvailableVoice() (compressedBytes uint32, uncompressedBytes uint32, result EVoiceResult)GetDurationControl() (control DurationControl, ok bool)GetEncryptedAppTicket(ticket []byte) (ticketSize uint32, ok bool)GetGameBadgeLevel(series int32, foil bool) int32GetHSteamUser() HSteamUserGetPlayerSteamLevel() int32GetSteamID() CSteamIDGetUserDataFolder() (path string, ok bool)GetVoice(wantCompressed bool, compressedData []byte, wantUncompressed bool, uncompressedData []byte, desiredSampleRate uint32) (compressedBytes uint32, uncompressedBytes uint32, result EVoiceResult)GetVoiceOptimalSampleRate() uint32InitiateGameConnection(authBlob []byte, steamIDGameServer CSteamID, ipServer uint32, portServer uint16, secure bool) int32RequestEncryptedAppTicket(dataToInclude []byte) SteamAPICall_tRequestStoreAuthURL(redirectURL string) SteamAPICall_tStartVoiceRecording()StopVoiceRecording()TerminateGameConnection(ipServer uint32, portServer uint16)TrackAppUsageEvent(gameID CGameID, eventCode int32, extraInfo string)UserHasLicenseForApp(steamID CSteamID, appID AppId_t) EUserHasLicenseForAppResult
ISteamUserStats (SteamUserStats() ISteamUserStats) — typed wrappers
GetAchievement(name string) (achieved, success bool)SetAchievement(name string) boolClearAchievement(name string) boolStoreStats() bool
ISteamUtils (SteamUtils() ISteamUtils) — typed wrappers
GetSecondsSinceAppActive() uint32GetSecondsSinceComputerActive() uint32GetConnectedUniverse() EUniverseGetServerRealTime() uint32GetIPCountry() stringGetImageSize(image int) (width, height uint32, ok bool)GetImageRGBA(image int, dest []byte) boolGetCurrentBatteryPower() uint8GetAppID() uint32IsOverlayEnabled() boolBOverlayNeedsPresent() boolIsSteamRunningOnSteamDeck() boolSetOverlayNotificationPosition(position ENotificationPosition)SetOverlayNotificationInset(horizontal, vertical int32)IsAPICallCompleted(call SteamAPICall_t) (failed bool, ok bool)GetAPICallFailureReason(call SteamAPICall_t) ESteamAPICallFailureGetAPICallResult(call SteamAPICall_t, callback uintptr, callbackSize int32, expectedCallback int32) (failed bool, ok bool)GetIPCCallCount() uint32ShowFloatingGamepadTextInput(...) bool
ISteamVideo (SteamVideo() ISteamVideo) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool.
SteamEncryptedAppTicket — typed utility wrappers
SteamEncryptedAppTicketBDecryptTicket(ticket, decrypted, key []byte) (decryptedSize uint32, ok bool)SteamEncryptedAppTicketBIsTicketForApp(decryptedTicket []byte, appID AppId_t) boolSteamEncryptedAppTicketGetTicketIssueTime(decryptedTicket []byte) uint32SteamEncryptedAppTicketGetTicketSteamID(decryptedTicket []byte) (CSteamID, bool)
steam_api (SteamAPIClient() ISteamAPIClient) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool.
steam_gameserver (SteamAPIGameServer() ISteamAPIGameServer) — handle-backed
- Returned wrapper struct shape:
{ ptr uintptr }with methodsPtr() uintptrandValid() bool.
Raw helpers return concrete Go wrapper structs per interface family; use Ptr() for FFI call entry and Valid() before invocation.
Interface raw helpers resolve the SteamAPI_* exported factory symbol and invoke it (zero-arg) to obtain the actual ISteam* instance pointer. If purego.Dlsym cannot resolve the factory symbol, the package attempts an ffi-based fallback lookup via github.com/jupiterrider/ffi.
SteamAppTicketRaw() ISteamAppTicket(ISteamAppTicket)SteamClientRaw() ISteamClient(ISteamClient)SteamControllerRaw() ISteamController(ISteamController)SteamGameCoordinatorRaw() ISteamGameCoordinator(ISteamGameCoordinator)SteamGameServerStatsRaw() ISteamGameServerStats(ISteamGameServerStats)SteamHTMLSurfaceRaw() ISteamHTMLSurface(ISteamHTMLSurface)SteamMatchmakingServersRaw() ISteamMatchmakingServers(ISteamMatchmakingServers)SteamMusicRaw() ISteamMusic(ISteamMusic)SteamNetworkingRaw() ISteamNetworking(ISteamNetworking)SteamRemotePlayRaw() ISteamRemotePlay(ISteamRemotePlay)SteamScreenshotsRaw() ISteamScreenshots(ISteamScreenshots)SteamTimelineRaw() ISteamTimeline(ISteamTimeline)SteamVideoRaw() ISteamVideo(ISteamVideo)SteamAPIClientRaw() ISteamAPIClient(steam_apifoundation; wrapped bySteamAPIClient())SteamAPIGameServerRaw() ISteamAPIGameServer(steam_gameserverfoundation; wrapped bySteamAPIGameServer())
Encrypted ticket utilities are also exposed with direct symbol wrappers:
SteamEncryptedAppTicketBDecryptTicket(ticket, decrypted, key []byte) (decryptedSize uint32, ok bool)SteamEncryptedAppTicketBIsTicketForApp(decryptedTicket []byte, appID AppId_t) boolSteamEncryptedAppTicketGetTicketIssueTime(decryptedTicket []byte) uint32SteamEncryptedAppTicketGetTicketSteamID(decryptedTicket []byte) (CSteamID, bool)
To access newer or unsupported Steamworks SDK methods, you can call raw symbols directly:
// Look up a symbol and call it directly (advanced usage).
ptr, err := steamworks.LookupSymbol("SteamAPI_ISteamFriends_GetPersonaName")
if err != nil {
panic(err)
}
result := steamworks.CallSymbolPtr(ptr)
_ = resultOr use CallSymbol to combine lookup + call:
result, err := steamworks.CallSymbol("SteamAPI_SteamApps_v008")
if err != nil {
panic(err)
}
_ = resultAll the source code files are licensed under Apache License 2.0.