A Swift package to directly interact with Steam.
- Login to a Steam account (via password or 2FA code)
- Retrieve basic user info
- Steam identifier
- Account flags
- Steam Community vanity profile URL
- Friends list Steam identifiers & friend status
- Add/remove friends
Swift Package Manager (Xcode):
- From the File menu, select Swift Packages › Add Package Dependency…
- Enter "https://github.com/sebj/steam" into the package repository URL text field
Swift Package Manager (standalone):
Add the following to the
dependencies of your
.package(url: "https://github.com/sebj/Steam.git", .upToNextMinor(from: "0.1"))
- Choose a server from
SteamServer.defaultServersor fetch the latest Steam server list using
- Instantiate a
SteamServiceand connect to the chosen server (
- Receive user information and friends list, and use any functions that require user authentication (
removeFriendetc) as desired.
Several Steam Protobufs from SteamDatabase/Protobufs and their converted Swift models (via Swift Protobuf) are bundled with this library, as Swift packages do not currently support running scripts/custom build phase actions (which would ideally be used to clone the Protobufs repo and convert & copy the relevant files).