The public surface of zsdk_swift is intentionally small. These are the types you interact with; everything else (networking, auth, and the individual screens) is internal.
The full-screen purchase flow. The SDK’s main entry point.
public struct ZuuppaTicketsScreen: View {
public init(
eventId: String,
config: ZuuppaConfig = .default,
onWalletPayment: ZuuppaWalletPaymentHandler? = nil,
onFinish: @escaping () -> Void = {}
)
public var body: some View
}Convenience modifier that presents the screen in a full-screen cover.
public extension View {
func zuuppaTickets(
isPresented: Binding<Bool>,
eventId: String,
config: ZuuppaConfig = .default,
onWalletPayment: ZuuppaWalletPaymentHandler? = nil
) -> some View
}Backend configuration. Defaults to production.
public struct ZuuppaConfig: Sendable {
public var apiBaseURL: URL
public var supabaseURL: URL
public var supabaseAnonKey: String
public init(apiBaseURL: URL, supabaseURL: URL, supabaseAnonKey: String)
public static let `default`: ZuuppaConfig
}The details passed to an in-app wallet handler.
public struct ZuuppaCryptoPaymentRequest: Sendable, Equatable {
public let orderID: String
public let chain: String
public let token: String
public let tokenMint: String?
public let decimals: Int
public let amountBaseUnits: String
public let depositAddress: String
public init(
orderID: String,
chain: String,
token: String,
tokenMint: String?,
decimals: Int,
amountBaseUnits: String,
depositAddress: String
)
}The closure your app supplies to pay a crypto order with its own wallet.
public typealias ZuuppaWalletPaymentHandler =
@Sendable (ZuuppaCryptoPaymentRequest) async throws -> String?Read-only Decodable models the SDK exposes. You don’t need them for a basic integration — the SDK fetches and renders them internally — but they’re public if you want to inspect event data.
public struct Event: Decodable, Sendable { /* id, name, startAt, ticketTypes, … */ }
public struct TicketType: Identifiable, Decodable, Sendable, Hashable { /* id, name, priceCents, … */ }
public struct Profile: Decodable, Sendable, Hashable { /* userID, fullName, username, … */ }public enum ZuuppaError: LocalizedError {
case network(URLError)
case server(status: Int, message: String?)
case decoding(String)
case notAuthenticated
case unknown
}
public enum OTPChannel: Sendable {
case email(String)
case phone(String)
}
public struct AuthIdentity: Sendable, Equatable {
public let email: String?
public let phone: String?
public var displayName: String { email ?? phone ?? "your account" }
}ZuuppaTicketsScreen / .zuuppaTickets(…). Add ZuuppaCryptoPaymentRequest and ZuuppaWalletPaymentHandler only for in-app wallet payments.