SteamUser allows you to communicate with the Steam servers in the same manner as a proper Steam client. It's designed to be a self-contained module which provides all the functionality expected of a Steam user client.
Subscribe to release announcements
Have a question about the module or coding in general? Do not create a GitHub issue. GitHub issues are for feature requests and bug reports. Instead, post in the dedicated forum. Such issues may be ignored!
Install it from npm:
$ npm install steam-user
Some of the documentation for SteamUser
, especially documentation for experimental features (but not exclusively),
is located in the GitHub wiki.
There are a number of coding patterns that are repeated throughout SteamUser
. Please read this section in its
entirety before starting work with SteamUser
.
All methods listed in this document that accept a callback also return a Promise
. You may use either callbacks or
promises.
Legacy callbacks return their data spanning across multiple arguments. All promises (which return any data at all)
return a single object containing one or more properties. The names of these properties for legacy callbacks are the
names of the callback arguments listed in this readme. Newer callbacks return a single object response
argument, which
is identical to the promise output for that method.
Some methods indicate that their callback is required or optional. You are never required to use callbacks over promises, but if a callback is listed as optional then an unhandled promise rejection will not raise a warning/error. If a callback is listed as required and you neither supply a callback nor handle the promise rejection, then a promise rejection will raise a warning, and eventually a crash in a future Node.js release.
There are a lot of enums used in Steam. They're all available directly from SteamUser
. For example, access EResult
using SteamUser.EResult
.
All enums can be viewed on GitHub.
Additionally, for convenience, the name of an enum value is available from any enum at the key identified by the enum
value. For example, given an EResult of 88
you can translate it using SteamUser.EResult[88]
which gives you
the string TwoFactorCodeMismatch
.
Static methods, or functions attached directly to SteamUser
, are called on the root module and not on instantiated handler instances.
amount
- The amount of the currencycurrency
- The currency code value in the ECurrencyCode
enumFormats a currency value and returns a string. For example:
console.log(SteamUser.formatCurrency(12.34, SteamUser.ECurrencyCode.USD)); // $12.34
console.log(SteamUser.formatCurrency(12345, SteamUser.ECurrencyCode.JPY)); // � 12345
console.log(SteamUser.formatCurrency(123.45, SteamUser.ECurrencyCode.EUR)); // 123,45�
There are a number of options which can control the behavior of the SteamUser
object. They are:
Controls where the Steam server list and sentry files are written. If null
, no data will be automatically stored.
Defaults to a platform-specific user data directory.
$OPENSHIFT_DATA_DIR/node-steamuser
%localappdata%\doctormckay\node-steamuser
~/Library/Application Support/node-steamuser
$XDG_DATA_HOME/node-steamuser
, or ~/.local/share/node-steamuser
if $XDG_DATA_HOME
isn't defined or is emptyIf you don't want to (or can't) save data to the disk, you can implement your own storage engine. To do this, simply add the following code:
user.storage.on('save', function(filename, contents, callback) {
// filename is the name of the file, as a string
// contents is a Buffer containing the file's contents
// callback is a function which you MUST call on completion or error, with a single error argument
// For example:
someStorageSystem.saveFile(filename, contents, function(err) {
callback(err);
});
});
user.storage.on('read', function(filename, callback) {
// filename is the name of the file, as a string
// callback is a function which you MUST call on completion or error, with an error argument and a Buffer argument
// For example:
someStorageSystem.readFile(filename, function(err, file) {
if(err) {
callback(err);
return;
}
callback(null, file);
});
});
In this manner, you can save data to a database, a cloud service, or anything else you choose.
A boolean which controls whether or not SteamUser
will automatically reconnect to Steam if disconnected due to Steam going down.
Defaults to true
.
A boolean which controls whether or not SteamUser
will use a single sentry file for all accounts.
If off, a file named sentry.accountname.bin
will be saved for each account.
If on, a file named sentry.bin
will be used for all accounts.
Defaults to false
.
What kind of machine ID will SteamUser send to Steam when logging on? Should be a value from EMachineIDType
.
Added in 1.7.0.
Defaults to AccountNameGenerated
.
If you're using machineIdType
AccountGenerated
, this is the format it uses. This is an array of three strings, each of which will be hashed with SHA1 before being sent to Steam. {account_name}
will be replaced with the current account name.
Added in 1.13.0.
Defaults to ["SteamUser Hash BB3 {account_name}", "SteamUser Hash FF2 {account_name}", "SteamUser Hash 3B3 {account_name}"]
.
If enabled, then node-steam-user
will internally cache data in memory about all apps and packages that it knows about.
Currently, node-steam-user
"knows about" an app/package if:
getProductInfo
getProductInfo
, orgetPersonas
This option is required in order to use several methods and events. This works when logging in anonymously.
Added in 3.3.0.
Defaults to false
.
If picsCacheAll
is enabled, enablePicsCache
is enabled, and changelistUpdateInterval
is nonzero, then apps and
packages which get updated while your bot is running will also be added to the cache. Default behavior is to only cache
apps and packages that are "known" via the above criteria.
Added in 3.3.0.
Defaults to false
.
If enablePicsCache
is enabled, then node-steam-user
will automatically request app/package changes (via
getProductChanges
) for known apps and packages, and update the internal cache when they update. This is the frequency,
in milliseconds, for changelist update requests. Set to 0
to disable.
Added in 3.3.0.
Defaults to 60000
. Minimum value 1000
, although you're recommended to not go below 10 seconds or so.
Set this to an object where keys are header names and values are header values, and those headers will be included
with all HTTP requests node-steam-user
makes to the Steam WebAPI.
Added in 3.29.0.
Defaults to {}
.
Pass an IP here (as a string) to bind to that address, or null
to let the OS decide.
Added in 4.0.0.
Defaults to null
.
Pass a port here to bind to that port, or null
to let the OS decide.
Added in 4.0.0.
Defaults to null
.
Specify a URL here to use an HTTP proxy. For example, http://user:pass@1.2.3.4:8081
Added in 4.0.0.
A value from EConnectionProtocol
.
Added in 4.0.0.
Defaults to Auto
.
Set this to the full name of a language (e.g. "english" or "spanish") to localize specific things within steam-user.
Currently this is only used to localize rich_presence_string
in user
event data and in requestRichPresence
.
Added in 4.0.0.
Defaults to english
.
If you're having trouble connecting to Steam (e.g. through a firewall or a proxy), set this to true
. When in web
compatibility mode, connections to Steam will always use WebSockets (the protocol
option will be ignored, and you
will get a warning if you set it to TCP
), and only Steam servers listening on port 443 will be considered.
Added in 4.6.0.
Defaults to false
.
null
if not connected, a SteamID
containing your SteamID otherwise.
An object containing options for this SteamUser
. Read-only; use setOption
or setOptions
to change an option.
v1.12.0 or later is required to use this property
Only defined if you're currently logged on. This is your public IP as reported by Steam, in "x.x.x.x" format.
v1.12.0 or later is required to use this property
Only defined if you're currently logged on. This is your cell (region ID) on the Steam network.
v3.7.0 or later is required to use this property
Only defined if you're currently logged on. This is your vanity URL (the part that goes after /id/
in your profile
URL). Falsy if you don't have one.
An object containing information about your account. null
until accountInfo
is emitted.
name
- Your account's Steam (persona) namecountry
- The country code from which you're logging in (via GeoIP), e.g. "US"authedMachines
- How many machines are authorized to login to your account with Steam Guardflags
- Your account's bitwise flagsfacebookID
- If your account is linked with Facebook, this is your Facebook account IDfacebookName
- If your account is linked with Facebook, this is your (real) name on FacebookAn object containing information about your account's email address. null
until emailInfo
is emitted.
address
- Your email addressvalidated
- true
if your email is validated, false
if notAn object containing information about your account's limitations. null
until accountLimitations
is emitted.
limited
- true
if your account is limited, false
if notcommunityBanned
- true
if your account is banned from Steam Community, false
if notlocked
- true
if your account is locked, false
if not (accounts can also be locked by Support)canInviteFriends
- true
if your account can invite friends, false
if notAn object containing information about your account's VAC bans. null
until vacBans
is emitted.
numBans
- How many bans are registered on your accountappids
- An array of AppIDs from which you're banned. Since each ban affects a range of AppIDs, some of the AppIDs in this array may not exist.An object containing information about your Steam Wallet. null
until wallet
is emitted.
hasWallet
- true
if your account has a Steam Wallet, false
if notcurrency
- The currency ID of your account's wallet (the enum of currencies is available as SteamUser.ECurrencyCode
)balance
- Your account's current wallet balanceAn array containing license data for the packages which your Steam account owns. null
until licenses
is emitted.
An array containing gifts and guest passes you've received but haven't accepted (to your library or to your inventory) or declined.
null
until gifts
is emitted. Each object in the array contains these properties:
gid
- The ID of this gift/guest pass, as a string (it's a 64-bit number)packageid
- The ID of the package which this gift/guest pass will grantTimeCreated
- A Date
object for when this gift was purchased or guest pass was grantedTimeExpiration
- A Date
object for when this guest pass will expire (if it's a gift, this will be Mon Jan 18 2038 22:14:07 GMT-0500 (Eastern Standard Time))TimeSent
- A Date
object for when this gift/guest pass was sent to youTimeAcked
- Appears to be the same as TimeSent
TimeRedeemed
- Appears to always be null
RecipientAddress
- Appears to always be an empty stringSenderAddress
- Appears to always be an empty stringSenderName
- The Steam display name of the user who sent you this giftAn object containing persona data about all Steam users we've encountered or requested data for. Key are 64-bit SteamIDs,
and values are identical to the objects received in the user
event.
This property may not be updated unless you set your instance to online.
An object containing information about all Steam groups we've encountered. Keys are 64-bit SteamIDs, and values are
identical to those received in the group
event.
This property may not be updated unless you set your instance to online.
An object containing information about all legacy chat rooms we're in. Keys are 64-bit SteamIDs, values are objects with this structure:
name
- The name of the chat, or empty if it's a multi-user chatprivate
- true
if only group members can join, false
if it's open to everyoneinvisibleToFriends
- true
if the chat is invisible to friends, false
if visible (unsure what this means at this time)officersOnlyChat
- true
if only group officers can chat right now, false
if everyone canunjoinable
- true
if the chat can't be joined, false
if it can (note that this doesn't necessary mean your effective access)members
- An object whose keys are 64-bit SteamIDs of users in this chat room, and whose values are objects with this structure:rank
- A value from EClanRank
permissions
- A bitstring of values in EChatPermission
for the user's permissions in this chatAn object whose keys are 64-bit SteamIDs, and whose values are values from the EFriendRelationship
enum. Therefore, you can deduce your friends list from this object.
When we get unfriended, instead of setting the value to EFriendRelationship.None
, the key is deleted from the object entirely.
This isn't populated after logon until friendsList
is emitted.
An object whose keys are 64-bit SteamIDs, and whose values are from the EClanRelationship
enum. Therefore, you can deduce which groups you're in from this object.
When we leave a group, instead of setting the value to EClanRelationship.None
, the key is deleted from the object entirely.
This isn't populated after logon until groupList
is emitted.
v1.10.0 or later is required to use this property
An object containing your friend groups (in the official client, these are called tags). Keys are numeric group IDs, and objects as follows:
name
- A string
containing the name of the group.members
- An array containing SteamID
objects for the members of this friend group.v3.15.0 or later is required to use this property
An object containing the nicknames you have assigned to other users. Keys are numeric 64-bit SteamIDs, properties are strings containing that user's nickname.
This is empty until nicknameList
is emitted.
v3.3.0 or later is required to use this property
An object containing cached data about known apps and packages. Only useful if the enablePicsCache
option is true
.
changenumber
- The last known changenumberapps
- An object whose keys are AppIDs and values are objects identical to those returned by getProductInfo
packages
- An object whose keys are PackageIDs and values are objects identical to those returned by getProductInfo
v4.0.0 or later is required to use this property
This is a SteamChatRoomClient
instance. Use this object to chat with friends and chat rooms.
Read SteamChatRoomClient docs here.
v4.2.0 or later is required to use this property
Contains the name of this package. The value is always "steam-user"
. This allows other modules to verify interoperability.
v4.2.0 or later is required to use this property
Contains the version of this package. For example, "4.2.0"
. This allows other modules to verify interoperability.
options
- An optional object containing zero or more options to set for this SteamUser
.Constructs a new SteamUser
.
Prior to v4.0.0, it was possible to pass a SteamClient instance as the first argument to this constructor. This functionality was removed in v4.0.0. See the full list of v4 changes.
option
- The name of the option to setvalue
- The value to set for this optionChanges the value of an option.
options
- An object containing zero or more options.sentry
- A Buffer containing the binary sentry file, binary SHA1 hash, or null
to unset the set sentryIf you aren't using dataDirectory
or you just want to provide your own sentry file, you can do it using this method.
You should call this before calling logOn
. When you log on, SteamUser
will use this sentry file.
You can provide either an entire sentryfile (preferred), or a Buffer containing the binary SHA1 hash of your sentryfile
(e.g. the output of the sentry
event in node-steam 0.6.x).
details
- An object containing details for this logonaccountName
- If logging into a user account, the account's namepassword
- If logging into an account without a login key or a web logon token, the account's passwordloginKey
- If logging into an account with a login key, this is the account's login keywebLogonToken
- If logging into an account with a client logon token obtained from the web, this is the tokensteamID
- If logging into an account with a client logon token obtained from the web, this is your account's SteamID, as a string or a SteamID
objectauthCode
- If you have a Steam Guard email code, you can provide it here. You might not need to, see the steamGuard
event. (Added in 1.9.0)twoFactorCode
- If you have a Steam Guard mobile two-factor authentication code, you can provide it here. You might not need to, see the steamGuard
event. (Added in 1.9.0)rememberPassword
- true
if you want to get a login key which can be used in lieu of a password for subsequent logins. false
or omitted otherwise.logonID
- A 32-bit integer to identify this login. The official Steam client derives this from your machine's private IP (it's the obfuscated_private_ip
field in CMsgClientLogOn
). If you try to logon twice to the same account from the same public IP with the same logonID
, the first session will be kicked with reason SteamUser.EResult.LogonSessionReplaced
. Defaults to 0
if not specified."192.168.1.5"
)machineName
- A string containing the name of this machine that you want to report to Steam. This will be displayed on steamcommunity.com when you view your games list (when logged in).clientOS
- A number to identify your client OS. Auto-detected if you don't provide one.dontRememberMachine
- If you're providing an authCode
but you don't want Steam to remember this sentryfile, pass true
here.v3.11.0 or later is required to use machineName
or dontRememberMachine
.
v4.3.0 or later is required to use webLogonToken
.
Logs onto Steam. Omit the details
object if you wish to login to an anonymous user account.
There are four ways to log onto Steam:
accountName
(or the details
object entirely) and you will log onto an anonymous user account.accountName
password
authCode
- Specify if you are using an email Steam Guard code.twoFactorCode
- Specify if you are using a TOTP two-factor code (required if your account has 2FA enabled).rememberPassword
- Specify if you want to get a login key for subsequent logins.logonID
- Defaults to 0 if not specified.machineName
- Defaults to empty string if not specified.clientOS
- Defaults to an auto-detected value if not specified.dontRememberMachine
- Only relevant if using an authCode
. Defaults to false
if not specified.loginKey
webLogonToken
steamID
accountName
loginKey
rememberPassword
- Specify if you want to get a new login key for subsequent logins.logonID
- Defaults to 0 if not specified.machineName
- Defaults to empty string if not specified.clientOS
- Defaults to an auto-detected value if not specified.password
authCode
twoFactorCode
dontRememberMachine
webLogonToken
steamID
webSession
will NOT be emitted automatically, and you will need to use webLogOn()
to get a web session.accountName
webLogonToken
steamID
password
authCode
twoFactorCode
dontRememberMachine
loginKey
rememberPassword
logonID
machineName
clientOS
Logs you off of Steam and closes the connection.
v3.18.0 or later is required to use this method
Logs you off of Steam and then immediately back on. If you aren't logged into an anonymous account, then you must
set rememberPassword
to true
when logging on initially to use this. You also must wait for the
loginKey
event to be emitted before you can use this. Attempts to call this method without both
criteria being met will result in an Error
being thrown and nothing else will happen.
When used, disconnected
and then loggedOn
will be emitted in succession. This is essentially the same as using
logOff()
and then calling logOn()
immediately in the disconnected
event callback.
SteamUser
will automatically log onto steamcommunity.com when a successful connection to Steam is established (as an
individual user), but you can call webLogOn()
to create a new session if your old one expires or becomes invalid.
Listen for the webSession
event to get your cookies.
callback
- Optional. Called when a response is availableerr
- An Error
object on failure, or null
on successRequests Steam to send you a validation email to your registered email address.
callback
- Required. Called when the activation email has been sent.err
- An Error
object on failure, or null
on successresponse
- An object containing the response datav2.0.0 or later is required to use this method
Starts the process to turn on TOTP for your account. You must have a phone number already linked with and verified on your account.
You'll be sent an SMS with an activation code that you'll need to provide to finalizeTwoFactor
.
You should save the entire response
object somewhere secure. You can use JSON.stringify
on it safely.
Properties of note in the response
object:
status
- A value from EResult
. If this is not OK
(1), then the request failed.shared_secret
- This is your secret that's used for two-factor authentication.identity_secret
- This is your secret that's used for trade confirmation.revocation_code
- You will need this in the future to disable two-factor authentication.secret
- A Buffer
containing your shared secretactivationCode
- A string
containing the activation code you got in your SMScallback
- Required.err
- An Error
object on failure, or null
on successv2.0.0 or later is required to use this method
Finishes the process of enabling TOTP two-factor authentication for your account. You can use steam-totp
in the future when logging on to get a code.
If TOTP two-factor authentication is enabled, a code will be required on every login unless a loginKey
is used.
callback
- A function to be called when the requested data is availableerr
- An Error
object on failure, or null
on successisSteamGuardEnabled
- true
if Steam Guard is enabled for your account, false
if nottimestampSteamGuardEnabled
- A Date
object representing when Steam Guard was enabled for your account, or null
if not availabletimestampMachineSteamGuardEnabled
- A Date
object representing when your current machine was authorized with Steam Guard, or null
if not availablecanTrade
- true
if Steam Guard will allow you to trade, false
if not. You may still be blocked by a trade ban or another trading limitation.timestampTwoFactorEnabled
- A Date
object representing when the Steam Guard Mobile Authenticator was enabled for your account, or null
if not enabledisPhoneVerified
- true
if your account has a linked phone, false
if notv1.11.0 or later is required to use this method.
v1.12.0 or later is required to use canTrade
.
v3.3.3 or later is required to use timestampTwoFactorEnabled
.
v3.5.0 or later is required to use isPhoneVerified
.
Requests details about your account's Steam Guard status. This could be used to see if your account passes the Steam Guard trading requirements.
In order to trade, all of the following must be true:
enabled
must be true
(account-level restriction)enabledTime
must be at least 15 days ago (account-level restriction)machineTime
OR twoFactorTime
must be at least 7 days ago (sentryfile-level restriction)callback
- A function to be called when the requested data is availableerr
- An Error
object on failure, or null
on successtimestampLastPasswordChange
- A Date
object representing when your password was last changed, or null
if never changedtimestampLastPasswordReset
- A Date
object representing when your password was last reset via the "forgot your password" utility, or null
if never resettimestampLastEmailChange
- A Date
object representing when your email address was last changed, or null
if never changedv3.10.0 or later is required to use this method
Gets when you last changed various account credentials.
callback
- A function to be called when the requested data is availableerr
- An Error
object on failure, or null
on successsecretID
- A numeric ID assigned to your key by Steamkey
- Your account's "auth secret", as a Buffer
v3.10.0 or later is required to use this method
Gets your account's auth secret, which is the pre-shared key used for in-home streaming.
callback
- A function to be called when the requested data is availableerr
- An Error
object on failure, or null
on successresponse
- The response objectprivacy_state
- The privacy state of your profileprivacy_state_inventory
- The privacy state of your Steam inventoryprivacy_state_gifts
- The privacy state of your Steam gift inventoryprivacy_state_ownedgames
- The privacy state of your owned games listprivacy_state_playtime
- The privacy state of your game playtimeprivacy_state_friendslist
- The privacy state of your friends listv4.11.0 or later is required to use this method
Retrieves your account's privacy settings. You can't change your privacy state using steam-user; you'll need to use steamcommunity.
callback
- Optional. A function to be called once Steam receives and responds to this request.err
- An Error
object on failure, or null
on successv3.21.0 or later is required to use this method
If this account is being used to play a game on another logon session, calling this method will kick that other session
off of Steam entirely (it will get an error
event if the other session is using node-steam-user).
apps
- An array, object, string, or number (see below)force
- Optional, default false
. If true
and this account is playing a game elsewhere, calls kickPlayingSession
first.v3.21.0 or later is required to use force
Reports to Steam that you're playing or using zero or more games/apps. To exit all games/apps, use an empty array []
.
To play a single game by AppID, use a single integer (e.g. 440
)
To play a single non-Steam game by name, use a single string (e.g. "Minecraft"
)
To play a single game by AppID and name (the client-provided name is what is given to the WebAPI and mobile app), use an object of this format:
{
"game_id": 440,
"game_extra_info": "Team Fortress 2"
}
You can use multiple apps by providing an array of any mixture of the above formats.
appid
- The AppID of the app for which you'd like the current player/user count (use 0
to get current logged-in Steam user count)callback
- Called when the requested data is availableerr
- An Error
object on failure, or null
on successplayerCount
- How many Steam users are currently playing/using the appRequests a count of how many Steam users are currently playing/using an app.
conditions
- A filter string or an object containing one or more of the following properties:app_id
- The AppID of the game for which you want serversgeo_location_ip
- The IP address of the querying client, used for geolocation (in x.x.x.x
format)region_code
- The region code where you want serversfilter_text
- A filter stringmax_servers
- Maximum number of servers to return in this response (default and hard limit 5000)callback
- Called when the response is availableerr
- If an error occurred, this is an Error
object. Otherwise, it's null
.servers
- An array of objects containing server dataip
- The server's IP in x.x.x.x
formatport
- The server's game portplayers
- How many authenticated players are on this server (the Steam server browser will use this value if the gameserver itself reports more players and doesn't report itself as full, to prevent inflated player counts)Requests a list of game servers from the master server.
filter
- A master server filter stringlimit
- How many servers should be returned, at maximum. Hard limit is 20,000.callback
- Called when the requested data is availableerr
- An Error
object on failure, or null
on successservers
- An array of objects containing server dataaddr
- The server's IP address in x.x.x.x:p
formatgameport
- The port the server is running on for game clientsspecport
- The port the server is running on for spectator clients (null
for none)steamid
- A SteamID
object containing the server's SteamIDname
- The server's hostnameappid
- The AppID of the game which the server is servinggamedir
- The directory of the game which the server is servingversion
- The version of the game which the server is servingproduct
- The product name of the game which the server is servingregion
- The region code for where the server is locatedplayers
- How many people are currently on this servermax_players
- How many people can be on the server at oncebots
- How many CPU players are currently on this servermap
- The name of the map which the server is currently runningsecure
- true
if the server is VAC-secure, false
if notdedicated
- true
if the server is dedicated, false
if listenos
- w
if the server is running on Windows, l
for Linuxgametype
- The server's tags, separated by commasWorks when anonymous. Requests a list gameservers from Steam matching a given filter, along with information about the server as Steam knows it.
ips
- An array of IP addresses, in x.x.x.x:p
formatcallback
- Called when requested data is availableerr
- An Error
object on failure, or null
on successservers
- An object whose keys are IP addresses in x.x.x.x:p
format and values are SteamID
objectsWorks when anonymous. Gets current SteamIDs for servers running on given addresses.
steamids
- An array of SteamID
objects, or something which can parse into one (64-bit SteamID as string, Steam3 rendered format)callback
- Called when requested data is availableerr
- An Error
object on failure, or null
on successservers
- An object whose keys are 64-bit numeric SteamIDs and values are IP addresses in x.x.x.x:p
formatWorks when anonymous. Gets current IP addresses for servers with given SteamIDs.
sinceChangenumber
- The changenumber of the last known changelist. You will get changes which have occurred since then and now. You won't get any info except the current changenumber if you request more than around 5,000 changenumbers in the past.callback
- Called when data is availableerr
- An Error
object on failure, or null
on successcurrentChangenumber
- The changenumber of the newest changelistappChanges
- An array of objects for apps which have changed. Each object has these properties:appid
- The AppID of the appchange_number
- The changenumber of the latest changelist in which the app has changedneeds_token
- true
if you need an access token to get most details about this app, null
if notpackageChanges
- An array of objects for packages which have changed. Each object has the same properties as the apps
array, except appid
is packageid
.Works when anonymous. Requests a list of all apps/packages which have changed since a given changenumber.
apps
- Either an array of AppIDs, or an array of objects containing appid
and access_token
propertiespackages
- Either an array of PackageIDs, or an array of objects containing packageid
and access_token
propertiesinclTokens
- Optional boolean to automatically request product access tokens if they need them. The default value is false.callback
- Called when requested data is availableerr
- An Error
object on failure, or null
on successapps
- An object whose keys are AppIDs and whose values are objectschangenumber
- The changenumber of the latest changelist in which this app changedmissingToken
- true
if you need to provide an access token to get more details about this appappinfo
- An object whose structure is identical to the output of app_info_print
in the Steam consolepackages
- An object whose keys are PackageIDs and whose values are objects. Each object has the same properties as the apps
array, except appinfo
is packageinfo
.unknownApps
- An array of input AppIDs which don't existunknownPackages
- An array of input PackageIDs which don't existWorks when anonymous. Requests details about one or more apps or packages.
If you have the PICS cache enabled and the risk of getting stale data is acceptable, you could check
the PICS cache if you want instead of calling getProductInfo
.
apps
- An array of AppIDspackages
- An array of PackageIDscallback
- Called when requested data is availableerr
- An Error
object on failure, or null
on successappTokens
- An object whose keys are AppIDs and whose values are access tokenspackageTokens
- An object whose keys are PackageIDs and whose values are access tokensappDeniedTokens
- An array of AppIDs for which Steam denied you an access tokenpackageDeniedTokens
- An array of PackageIDs for which Steam denied you an access tokenWorks when anonymous. Requests access tokens for one or more apps or packages. These access tokens can be used with getProductInfo
.
Access tokens are global. That is, everyone who has access to an app receives the same token. Tokens do not seem to expire.
excludeSharedLicenses
- Pass true
to exclude apps that are owned via a shared license, and not directly on this account (default false
)v3.3.0 or later is required to use this method
v4.7.0 or later is required to use excludeSharedLicenses
Returns an array of AppIDs which your account owns. This cannot be safely called until appOwnershipCached
is emitted.
enablePicsCache
must be true
to use this method. Otherwise, an Error
will be thrown.
appid
- A numeric AppIDexcludeSharedLicenses
- Pass true
to exclude apps that are owned via a shared license, and not directly on this account (default false
)v3.3.0 or later is required to use this method
v4.7.0 or later is required to use excludeSharedLicenses
Returns true
if your account owns the specified AppID, or false
if not. This cannot be safely called until
appOwnershipCached
is emitted.
enablePicsCache
must be true
to use this method. Otherwise, an Error
will be thrown.
excludeSharedLicenses
- Pass true
to exclude depots that are owned via a shared license, and not directly on this account (default false
)v3.3.0 or later is required to use this method
v4.7.0 or later is required to use excludeSharedLicenses
Returns an array of depot IDs which your account owns. This cannot be safely called until appOwnershipCached
is emitted.
enablePicsCache
must be true
to use this method. Otherwise, an Error
will be thrown.
depotid
- A numeric depot IDexcludeSharedLicenses
- Pass true
to exclude depots that are owned via a shared license, and not directly on this account (default false
)v3.3.0 or later is required to use this method
v4.7.0 or later is required to use excludeSharedLicenses
Returns true
if your account owns the specified depot, or false
if not. This cannot be safely called until
appOwnershipCached
is emitted.
enablePicsCache
must be true
to use this method. Otherwise, an Error
will be thrown.
excludeSharedLicenses
- Pass true
to exclude packages that are owned via a shared license, and not directly on this account (default false
)v3.3.0 or later is required to use this method
v4.7.0 or later is required to use excludeSharedLicenses
Returns an array of package IDs which your account owns. If you logged in anonymously, this can be safely called
immediately following logon. Otherwise, this cannot be safely called until licenses
is emitted.
packageid
- A numeric package IDexcludeSharedLicenses
- Pass true
to exclude packages that are owned via a shared license, and not directly on this account (default false
)v3.3.0 or later is required to use this method
v4.7.0 or later is required to use excludeSharedLicenses
Returns true
if your account owns the specified package ID, or false
if not. If you logged in anonymously, this can
be safely called immediately following logon. Otherwise, this cannot be safely called until licenses
is emitted.
language
- The language you want tag names in, e.g. "english" or "spanish"tagIDs
- An array of one or more tag IDscallback
- A function to be called when the requested data is availableerr
- An Error
object on failure, or null
on successtags
- An object whose keys are tag IDs and values are objects with two properties: name
and englishName
v3.26.0 or later is required to use this method
Retrieves localized names for specified store tag IDs. Tag IDs are available in the response to getProductInfo
.
ids
- Either an integer, or an array of integers containing the IDs of the published file(s) you want details forcallback
- A function to be called when the request has completederr
- An Error
object on failure, or null
on successfiles
- An object whose keys are published file IDs, and values are object containing a ton of informationv3.8.0 or later is required to use this method
Gets details for one or more published files. Published files are anything with a URL like
https://steamcommunity.com/sharedfiles/filedetails/?id=662626851
(where id
is the published file ID).
The amount of data available in results
is huge, so I can only suggest that you console.log
it to see what's
available.
state
- A value from EPersonaState
name
- Optional. Your new profile namev1.9.0 or later is required to use this method
Changes our online status, and optionally your profile name. You need to call this after you logon or else you'll show up as offline. You won't receive any persona data about your friends if you don't go online.
mode
- A value from EClientUIMode
v3.7.0 or later is required to use this method
Sets your current UI mode, which displays as an icon next to your online status in Steam chat and the friends list.
steamID
- The SteamID of the user you want to add as a friend, as a SteamID
object or a string that can parse into onecallback
- Optional. Called when Steam responds to this request.err
- An Error
object on failure, or null
on success. If this is an Error
object, it will have an eresult
property.personaName
- If successful, the current persona name of the user you added.v1.9.0 or later is required to use this method. v3.10.0 or later is required to use callback
.
Sends a friend request to the user with the specified SteamID
. If they've already sent you a friend request, accepts it.
If you provide a callback, the message
of the err
will be DuplicateName
and the eresult
will be 14
if we are
already friends with the requested user, or if we've sent them a friend request already that they haven't accepted or
ignored. message
will be Blocked
and eresult
will be 40
if they've blocked us.
steamID
- The SteamID of the user you want to remove from your friends list, as a SteamID
object or a string that can parse into onev1.9.0 or later is required to use this method
Removed a specified user from your friends list. Also ignores an outstanding friend request from this user.
steamID
- The SteamID of the user you want to block, as a SteamID
object or a string that can parse into onecallback
- Optional. Called when the request completeserr
- An Error
object on failure, or null
on successv1.9.0 or later is required to use this method
Blocks all communication with a specified user.
steamID
- The SteamID of the user you want to unblock, as a SteamID
object or a string that can parse into onecallback
- Optional. Called when the request completeserr
- An Error
object on failure, or null
on successv1.9.0 or later is required to use this method
Unblocks all communication with a specified user.
options
- Optional. An object with zero or more of these properties:inviteLimit
- How many times this link can be used before it's no longer valid. Defaults to 1.inviteDuration
- How long in seconds this link can be used before it's no longer valid. Defaults to null
(no time limit).callback
- Called when the request completeserr
- An Error
object on failure, or null
on successresponse
- The response objecttoken
- An object with these properties:invite_link
- The link that can be used to add your account as a friend directlyinvite_token
- Just the token part of the linkinvite_limit
- How many times the link can be used before it's no longer validinvite_duration
- How many seconds are left until the link expires. null
if it never expires.time_created
- A Date
object representing when the link was createdvalid
- true
if the link is currently valid, or false
if notv4.11.0 or later is required to use this method
v4.13.0 or later is required to use inviteDuration
Creates a quick-invite link that can be used by anyone who has it to add you to their friends list without needing to send an invite that you must to approve.
callback
- Called when the request completeserr
- An Error
object on failure, or null
on successresponse
- The response objecttokens
- An array of objects, each of which is identical to the output of createQuickInviteLink
v4.11.0 or later is required to use this method
Retrieves the list of quick-invite links on your account. Links that you've revoked won't appear here.
linkOrToken
- Either the full link, or just the token part of the linkcallback
- Optional. Called when the request completeserr
- An Error
object on failure, or null
on successv4.11.0 or later is required to use this method
Revokes a quick-invite link. Can also be used to delete an already-used code from listQuickInviteLinks
.
link
- The full quick-invite linkv4.11.0 or later is required to use this method
Decodes a quick-invite link and returns a SteamID
object representing the user account to whom this link belongs.
Returns null
if the link is not well-formed.
This happens offline and thus returns immediately, without need for a callback or Promise.
link
- The full quick-invite linkcallback
- Called when the request completeserr
- An Error
object on failure, or null
on successresponse
- The response objectvalid
- true
if the link exists and is valid, false
if the link exists but is not valid (e.g. it's already been used); it's an error if the link doesn't exist at allsteamid
- A SteamID
object representing who the link belongs toinvite_duration
- How many seconds are left until the link expires. null
if it never expires.v4.11.0 or later is required to use this method
Checks whether a quick-invite link is valid.
link
- The full quick-invite linkcallback
- Optional. Called when the request completeserr
- An Error
object on failure, or null
on successv4.11.0 or later is required to use this method
Redeems a quick-invite link and adds the user to your friends list.
steamids
- An array of SteamID
objects or strings which can parse into SteamID
objectscallback
- Optional. Called when the requested data is available.err
- An Error
object on failure, or null
on successpersonas
- An object whose keys are 64-bit SteamIDs and whose values are objects identical to those received in the user
eventv1.9.0 or later is required to use this method
Requests persona data for one or more users from Steam. The response will arrive in the user
event, or in the callback if provided.
appID
- The ID of the app for which you want to upload rich presence data. You should be playing this app.richPresence
- An object containing your rich presence data. All values should be strings.v4.4.0 or later is required to use this method
Uploads rich presence data to Steam. In order to display text in the Steam friends list, you need a key named steam_display
,
which must be a rich presence localization key (you can see RP keys for apps on SteamDB).
%placeholders%
in the rich presence localization value will be replaced with the value of the corresponding key that
you upload. For example, to get a TF2 RP string of "Special Event - Hello, World!", then you should upload:
{
"steam_display": "#TF_RichPresence_Display",
"state": "PlayingMatchGroup",
"matchgrouploc": "SpecialEvent",
"currentmap": "Hello, World!"
}
This will subsequently be parsed like this:
#TF_RichPresence_Display
= {#TF_RichPresence_State_%state%}
{#TF_RichPresence_State_PlayingMatchGroup}
= {#TF_RichPresence_MatchGroup_%matchgrouploc%} - %currentmap%
{#TF_RichPresence_MatchGroup_SpecialEvent} - Hello, World!
Special Event - Hello, World!
appID
- The ID of the app for which you want rich presence localizationslanguage
- The full name of the language you want, e.g. "english" or "spanish"callback
- Called when the requested data is available.err
- An Error
object on failure, or null
on successresponse
- The response objecttokens
- An object where keys are localization tokens (prefixed with #
, e.g. #TF_RichPresence_Display
) and values are localized stringsv4.0.0 or later is required to use this method
Requests localized rich presence strings for a particular app in the given language. This will allow you to decode the
rich_presence
array in the user
event into the localized string displayed in the Steam client.
appID
- The ID of the app for which you want to get rich presence data forsteamIDs
- An array of SteamID objects or strings that can parse into SteamID objectslanguage
- Optional. A string containing a full language name (e.g. 'english'
or 'spanish'
). Defaults to language passed in constructor or setOption
if omitted.callback
- Called when the requested data is available.err
- An Error
object on failure, or null
on successresponse
- The response objectusers
- An object whose keys are 64-bit SteamIDs (as strings) and whose values are objects containing the received rich presence data. If no data was received for a SteamID there will be no key for that SteamID (and therefore no value).v4.18.0 or later is required to use this method
Requests rich presence key/value data and localized strings as displayed in Steam for a list of given users, for a given app. You do not need to be friends with the requested users. Response object looks like this:
{
"users": {
"76561198006409530": {
"richPresence": {
"status": "Playing CS:GO",
"version": "13765",
"time": "15.851017",
"game:state": "lobby",
"steam_display": "#display_Menu",
"connect": "+gcconnectG02C0193A"
},
"localizedString": "Playing CS:GO"
}
}
}
If the Steam display string cannot be localized, then localizedString
will be null. This is the case when there exists
no translation for the language you selected.
steamids
- An array of SteamID
objects or strings that can parse into SteamID
objectscallback
- Called when the requested data is available.err
- An Error
object on failure, or null
on successusers
- An object whose keys are 64-bit SteamIDs (as strings) and whose values are Steam levelsv1.9.0 or later is required to use this method
Gets the Steam Level for one or more Steam users (who do not have to be on your friends list).
steamids
- An array of SteamID
objects or strings that can parse into SteamID
objectscallback
- Called when the requested data is availableerr
- An Error
object on failure, or null
on successusers
- An object whose keys are 64-bit SteamIDs (as strings) and whose values are objects containing the following properties:name
- The new name adopted by the user, as a stringname_since
- A Date
object representing when the user adopted this namev3.10.0 or later is required to use this method
Gets the last 10 persona names (including the current one) used by one or more Steam users (who do not have to be on your friends list).
callback
- Optional. Called when the requested data is availableerr
- An Error
object on failure, or null
on successnicknames
- An object whose keys are 64-bit SteamIDs (as strings) and whose values are nicknames for the corresponding users (as strings)v3.23.0 or later is required to use this method
Retrieves an up-to-date nickname list (see nicknameList
) from Steam. The nicknameList
event will be
emitted when the response to this request is received, immediately after the callback fires. If you provide no callback,
the nicknameList
event is still emitted.
In theory, the nickname list in myNicknames
will always be up-to-date since v3.23.0, but you may wish to use this if
you want to be doubly sure.
steamID
- The SteamID of the user on whom you want to set a nickname, as a SteamID
object or a string that can parse into onenickname
- The user's new nickname, as a string. Empty string to remove.callback
- Optional. Called when the request completes.err
- An Error
object on failure or null
on success.v3.15.0 or later is required to use this method
Sets a nickname on a user. If one already exists, overwrites it. The myNicknames
property will be updated just before
the callback fires, on success.
Note: It appears to be possible for Steam to report success when using this method, when in reality your nickname
wasn't saved on the server. You can detect this case by calling getNicknames
.
appid
- The AppID of the game you want to get your badge level forcallback
- Called when the requested data is available.err
- An Error
object on failure, or null
on successsteamLevel
- Your own Steam levelregularBadgeLevel
- The level on your badge for this game (0 if you don't have one)foilBadgeLevel
- The level on your foil badge for this game (0 if you don't have one)v3.8.0 or later is required to use this method
Gets your own Steam Level, and the level you have on a badge for a particular game.
steamID
- Either a SteamID
object or a string that can parse into oneoptions
- Optional. An object with zero or more of these properties:includePlayedFreeGames
- Set to true
to include free games that the user has used before. Default false
.filterAppids
- Pass an array of numeric AppIDs here to only retrieve those appsincludeFreeSub
- Set to true
to include apps owned through Steam Sub 0callback
- Called when the request completes.err
- An Error
object on failure or null
on success.response
- The response objectgame_count
- A number indicating how many total apps this user ownsgames
- An array of objects:appid
- The ID of the appname
- The name of the appplaytime_2weeks
- How many minutes this user has played in the past 2 weeks (may be null
)playtime_forever
- How many minutes this user has played all timeimg_icon_url
- A URL to the app's 32x32 square icon imageimg_logo_url
- A URL to the app's 184x69 capsule logo imagehas_community_visible_stats
- true
if this app has visible community stats (e.g. /profiles/:steamID/stats/:appid)playtime_windows_forever
- How many minutes this user has played all time on Windowsplaytime_mac_forever
- How many minutes this user has played all time on Macplaytime_linux_forever
- How many minutes this user has played all time on Linuxv4.16.0 or later is required to use this method
Retrieves a user's list of owned apps. The user's games must not be private.
This is functionally identical to IPlayerService/GetOwnedGames but with some minor data processing.
appID
- The ID of the app you want to checkcallback
- Called when the request completes.err
- An Error
object on failure, or null
on successresponse
- The response objectfriends
- An array of SteamID
objectsv4.20.0 or later is required to use this method
Retrieves a list of friends that have played or used an app.
options
- Optional. An object with zero or more of these properties:language
- A language to localize item data into. Defaults to english
callback
- Called when the request completes.err
- An Error
object on failure or null
on success.response
- The response object. Each property is an array of profile item data objects.profile_backgrounds
- Owned profile backgroundsmini_profile_backgrounds
- Owned miniprofile backgroundsavatar_frames
- Owned avatar framesanimated_avatars
- Owned animated avatarsprofile_modifiers
- Owned profile modifiersv4.16.0 or later is required to use this method
Retrieves a listing of all profile items you currently own.
Profile item objects have these properties:
communityitemid
- The asset ID of the itemimage_small
- The URL to the image shown in the inventory. May be null
.image_large
- The URL to the full size of the item's image. May be null
if not a profile background.name
- The internal name of the itemitem_title
- The localized name of the itemitem_description
- The localized description of the itemappid
- The AppID of the app which owns this backgrounditem_type
item_class
movie_webm
- The URL to a webm version of a video associated with this item, likely for animated avatars.movie_mp4
- The URL to an mp4 version of a video associated with this item, likely for animated avatars.equipped_flags
- Unknown at this timesteamID
- Either a SteamID
object or a string that can parse into one for the user whose currently-equiped profile items you want to seeoptions
- Optional. An object with zero or more of these properties:language
- A language to localize item data into. Defaults to english
callback
- Called when the request completes.err
- An Error
object on failure or null
on successresponse
- The response object. Each property is either null
or a profile item data objectprofile_background
mini_profile_background
avatar_frame
animated_avatars
profile_modifiers
v4.16.0 or later is required to use this method
Retrieves a list of a given user's equipped profile items.
backgroundAssetID
- The asset ID of the item you want to set as your background. Use 0
to remove your background.callback
- Optional. Called when the request completes.err
- An Error
object on failure or null
on success.v4.16.0 or later is required to use this method
Changes your own profile background.
userSteamID
- The SteamID of the user you want to invite, as a SteamID
object or a string which can parse into onegroupSteamID
- The SteamID of the group you want to invite the user to, as a SteamID
object or a string which can parse intoVersion | Tag | Published |
---|---|---|
4.20.2 | latest | 1yr ago |