You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JellyfinClient uses an underlying Get APIClient to provide basic functionality for interfacing with a Jellyfin server:
inject required Authorization header for every request
encoding/decoding of expected Date values
signIn for generating a session access token
signOut for revoking the current access token
// Create client instance
letjellyfinClient=JellyfinClient(configuration: configuration)
// Sign in user with credentials
letresponse= jellyfinClient.signIn(username:"jelly", password:"fin")
Alternatively, you can use your own network stack with the generated Entities and Paths.
Quick Connect
The QuickConnect object has been provided to perform the Quick Connect authorization flow.
/// Create a QuickConnect object with a JellyfinClient
letquickConnect=QuickConnect(client: client)letquickConnectState=Task{
/// Listen to QuickConnect states with async/await or Combine
forawaitstatein quickConnect.$state.values {switch state {
/// Other cases ommitted
caselet.polling(code: code):print(code)caselet.authenticated(secret: secret):
/// Sign in with the Quick Connect secret
client.signIn(quickConnectSecret: secret)}}}
/// Start the Quick Connect authorization flow
quickConnect.start()
Generation
# Download latest spec and run CreateAPI
$ make update
Alternatively, you can generate your own Swift Jellyfin SDK using CreateAPI or any other OpenAPI generator.