A Swift SDK for the DriveThruRPG API.
Provides configuration, authentication/session lifecycle, and library backend operations for listing and downloading ordered products and managing product lists (collections).
Requires macOS 15+ and Swift 6.2+ (see .swift-version).
Add the package to Package.swift:
.package(url: "https://github.com/pilgrimagesoftware/dtrpg-sdk.swift.git", from: "1.0.0")This repository uses the dtrpg-api repository as a submodule (API/). Sources/SDK/openapi.yaml symlinks to
API/openapi.yaml, which swift-openapi-generator reads at build time. Clone with submodules, or initialize them
after cloning:
git clone --recursive https://github.com/pilgrimagesoftware/dtrpg-sdk.swift.git
# or, if already cloned:
git submodule update --init --recursiveimport DriveThruRPGSDK
let sdk = SDK()
try sdk.configure(with: Config(apiKey: "my-app-key"))
// After receiving an auth response from the API:
let session = try await sdk.authenticate()
// Library operations require an active session:
let library = try await sdk.listOrderProducts(LibraryItemsParams(library: true))See the Swift Package Index documentation
for the full API reference, including Config, AuthSession/AuthState, and the library operations
(listOrderProducts, getOrderProduct, prepareDownload, listProductLists, createProductList, and more).
swift build
swift testSee CONTRIBUTING.md for commit conventions and branch/PR expectations.
See RELEASE.md.
MIT — see LICENSE.md.