Repository navigation
espnKit 4.0.35.343
·
258 commits
to main
since this release
espnKit
Kotlin Multiplatform framework for the Maestro ESPN SDK. Ships the standalone
ScoreboardHandle for the Out of Town Scoreboard panel: the host app owns config and
auth and pushes them into the handle; the handle polls and emits render-ready states.
Installation
Add the binary target from this release to your Package.swift (the exact
url and checksum are in the release notes below):
.binaryTarget(
name: "espnKit",
url: "<release zip url>",
checksum: "<checksum>"
)Quick Start
import espnKit
// baseUrl swaps the default ESPN site API root for an internal/dev endpoint
let handle = ScoreboardHandle.companion.startStandalone(isProduction: true, userAgent: nil, baseUrl: nil)
handle.subscribe { state in
// state.status: "loading" | "success" | "error" | "empty"
// state.sections: sections of games, render-ready
// live games carry watchLive (airingId, link) for the host's player
// every game carries textElements: the status lines in API order, each with
// a type ("text" | "date" | "time") and a style ("regular" | "light")
}
// push the host-owned request context; call again whenever it changes
handle.setConfig(
eventId: eventId,
swid: swid,
authToken: jwt,
postalCode: postalCode,
region: nil,
lang: nil,
overrideUrl: nil,
pinnedEvents: nil
)
// lifecycle
handle.pause() // stops polling while the panel is hidden
handle.resume()
handle.close()
// Kotlin Array fields bridge as KotlinArray; unwrap with a small helper:
extension KotlinArray {
func toSwiftArray<T>() -> [T] { (0..<size).compactMap { get(index: $0) as? T } }
}A complete SwiftUI example lives in demos/demo-tvos-espn/ in the source repo.
License
Copyright (c) LessThan3
Installation
.binaryTarget(
name: "espnKit",
url: "https://github.com/lessthan3/MaestroKit.android/releases/download/espnKit-4.0.35.343/espnKit-4.0.35.343.zip",
checksum: "a79e453788a83a88745a9a031bd85de224708e78ec52c8e2b197881e7eca4fb2"
)