Service

  • Service responsible for sending generated App Store Connect requests.

    A service instance owns the current JWT and automatically refreshes its signature before a request is sent if the token has expired. It also centralizes response decoding, HTTP error mapping, and pagination helpers for responses conforming to PagedResponse.

    See more

    Declaration

    Swift

    public actor BagbutikService
  • JWT

    A JSON Web Token used to authorize requests sent through BagbutikService.

    Bagbutik creates tokens with Apple’s required ES256 signature and a 20 minute expiration. When a service sends a request, the signature is regenerated automatically if the current token has expired.

    Full documentation for how JWT is used with the API: https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests

    See more

    Declaration

    Swift

    public struct JWT : Sendable
  • FetchData Asynchronous

    The async transport closure used by BagbutikService.

    Provide a custom implementation when you want to stub network traffic in tests, route requests through a custom URLSession, or attach your own delegate handling.

    Declaration

    Swift

    public typealias FetchData = @Sendable (_ request: URLRequest, _ delegate: URLSessionTaskDelegate?) async throws -> (Data, URLResponse)

    Parameters

    request

    The request to execute.

    delegate

    An optional task specific delegate.

    Return Value

    The raw response body and URL response returned by the transport.

  • Errors from the API or from the decoding of the responses.

    See more

    Declaration

    Swift

    public enum ServiceError : Error