Skip to content

Repository files navigation

dtrpg-sdk.swift

PR License: MIT

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).

Installation

Add the package to Package.swift:

.package(url: "https://github.com/pilgrimagesoftware/dtrpg-sdk.swift.git", from: "1.0.0")

Building from source

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 --recursive

Quick Start

import 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).

Development

swift build
swift test

See CONTRIBUTING.md for commit conventions and branch/PR expectations.

Release Process

See RELEASE.md.

License

MIT — see LICENSE.md.

About

An SDK library for DriveThru RPG API in Swift

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages