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)
- 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.
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)let raw = try await client.users.getUser(pathParameters: ["id": "123"])
let json = try raw.decodeJSON()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(...).
AudiusAPIClient.shared exists as a deprecated migration bridge.
let shared = AudiusAPIClient.shared
let client = shared.clientUse AudiusClient(configuration:) for all new code.
Regenerate typed surface:
ruby Scripts/generate_typed_surface.rb ./swagger.yamlRegenerate operation manifest fixture:
ruby Scripts/generate_operation_manifest.rb ./swagger.yaml Tests/AudiusKitTests/Fixtures/operation_manifest.jsonRun codegen parity check:
Scripts/check_codegen.sh ./swagger.yamldocumentation/Getting-Started.mddocumentation/Architecture.mddocumentation/Usage-Guide.mddocumentation/API-Reference.mddocumentation/Troubleshooting.mddocumentation/Migration-v1-to-v2.md