zuuppaDEV
Swift SDK

API reference

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.

ZuuppaTicketsScreen

The full-screen purchase flow. The SDK’s main entry point.

swift
public struct ZuuppaTicketsScreen: View {
    public init(
        eventId: String,
        config: ZuuppaConfig = .default,
        onWalletPayment: ZuuppaWalletPaymentHandler? = nil,
        onFinish: @escaping () -> Void = {}
    )

    public var body: some View
}

View.zuuppaTickets(…)

Convenience modifier that presents the screen in a full-screen cover.

swift
public extension View {
    func zuuppaTickets(
        isPresented: Binding<Bool>,
        eventId: String,
        config: ZuuppaConfig = .default,
        onWalletPayment: ZuuppaWalletPaymentHandler? = nil
    ) -> some View
}

ZuuppaConfig

Backend configuration. Defaults to production.

swift
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
}

ZuuppaCryptoPaymentRequest

The details passed to an in-app wallet handler.

swift
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
    )
}

ZuuppaWalletPaymentHandler

The closure your app supplies to pay a crypto order with its own wallet.

swift
public typealias ZuuppaWalletPaymentHandler =
    @Sendable (ZuuppaCryptoPaymentRequest) async throws -> String?

Domain models

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.

swift
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, … */ }

Auth & error types

swift
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" }
}
For a basic ticketing integration you only touch ZuuppaTicketsScreen / .zuuppaTickets(…). Add ZuuppaCryptoPaymentRequest and ZuuppaWalletPaymentHandler only for in-app wallet payments.