Skip to content

A modern Swift package for integrating Audius music content into your iOS, macOS, tvOS, or watchOS app. AudiusKit provides a type-safe, async/await-based read-only API for accessing and streaming content from the Audius Music catalogue.

License

Notifications You must be signed in to change notification settings

julianbaker/audiusKit

Repository files navigation

AudiusKit v2

AudiusKit v2 is a typed Swift SDK for the Audius/Open Audio Protocol API, generated from:

swagger.yaml (or a path you provide at generation time)

Highlights

  • Full operation coverage (157) with typed wrappers.
  • Typed domain models (Track, User, Playlist, Comment, Coin, etc.).
  • Generic response envelopes (AudiusEnvelope, AudiusListEnvelope, AudiusOptionalEnvelope).
  • Raw API escape hatch preserved.
  • Bearer-first write execution with optional proxy fallback.
  • OAuth/session helpers for iOS system auth.

Quick Start (Typed)

import AudiusKit

let client = AudiusClient(
  configuration: AudiusClientConfiguration(
    appName: "MyiOSApp",
    auth: AudiusAuthConfiguration(mode: .sessionBearer),
    sessionStore: KeychainSessionStore()
  )
)

let user = try await client.typed.users.getUser(.init(id: "123"))
print(user.data.name)

Raw Escape Hatch

let raw = try await client.users.getUser(pathParameters: ["id": "123"])
let json = try raw.decodeJSON()

iOS Auth

AudiusKit does not render login UI. Host apps launch Audius auth via ASWebAuthenticationSession, parse callback state/token with client.auth, then materialize a verified session using client.auth.createSession(...).

Optional Legacy Shim

AudiusAPIClient.shared exists as a deprecated migration bridge.

let shared = AudiusAPIClient.shared
let client = shared.client

Use AudiusClient(configuration:) for all new code.

Codegen

Regenerate typed surface:

ruby Scripts/generate_typed_surface.rb ./swagger.yaml

Regenerate operation manifest fixture:

ruby Scripts/generate_operation_manifest.rb ./swagger.yaml Tests/AudiusKitTests/Fixtures/operation_manifest.json

Run codegen parity check:

Scripts/check_codegen.sh ./swagger.yaml

Documentation

  • documentation/Getting-Started.md
  • documentation/Architecture.md
  • documentation/Usage-Guide.md
  • documentation/API-Reference.md
  • documentation/Troubleshooting.md
  • documentation/Migration-v1-to-v2.md

About

A modern Swift package for integrating Audius music content into your iOS, macOS, tvOS, or watchOS app. AudiusKit provides a type-safe, async/await-based read-only API for accessing and streaming content from the Audius Music catalogue.

Topics

Resources

License

Stars

Watchers

Forks