mirror of
https://github.com/jellyfin/jellyfin-sdk-swift.git
synced 2024-11-23 06:09:58 +00:00
Swift SDK for Jellyfin
JellyfinAPI.doccarchive | ||
Plugins/CreateAPI | ||
Sources | ||
.gitignore | ||
.swiftformat | ||
Package.resolved | ||
Package.swift | ||
README.md |
Jellyfin SDK for Swift
A Swift async/await SDK for Jellyfin, generated using CreateAPI.
Usage
The JellyfinClient
object is a wrapper around Get's APIClient to provide basic functionality for interfacing with a Jellyfin server, notably injecting required headers for each request. JellyfinClient
uses the same API as APIClient
for making all requests.
You are still able to use any networking stack you desire by using the provided Entities and Paths.
let jellyfinClient = JellyfinClient(configuration: configuration)
// Provided method on JellyfinClient
let response = jellyfinClient.signIn(username: "jelly", password: "fin")
Generation
Generating and updating the Entities, Extensions, and Paths with CreateAPI is provided as an Xcode command plugin.
- Download the latest Jellyfin schema
- Move the schema to /Sources
- Delete the current Entities, Extensions, and Paths directories
- Run the following command in the package directory:
# runs the CreateAPI Xcode command plugin
$ swift package --allow-writing-to-package-directory generate-api
- New Entities, Extensions, and Paths directories should be available within the package