fs app store connect client

This Swift package provides a client library for interacting with the App Store Connect API. It leverages the power of Swift OpenAPI Generator to automatically generate code from the provided OpenAPI specification file (openapi.yaml).

FSAppStoreConnectClient

Swift Version
License
GitHub release (with filter)
Read the Docs
example workflow
example workflow
example workflow
codecov

This Swift package provides a client library for interacting with the App Store Connect API. It leverages the power of Swift OpenAPI Generator to automatically generate code from the provided OpenAPI specification file (openapi.yaml).

Features

  • Find and list your apps in App Store Connect.
  • Get a list of all App Store versions of your app across all platforms.
  • Get a list of all build TestFlight versions of your app.
  • Retrieve the TestFlight prerelease version and the platform for which the prerelease version is intended.
  • Using secure JWT-authenticated requests.
  • Handles JSON formats response.
  • Implemented control over the number of requests from users and handling of rate limit errors.
  • Providing automatically retrying HTTP requests based on customizable retry failed signals and delay strategies.
  • Throws informative errors for server errors and not found cases.
  • Ensure test coverage for code to guarantee robustness and reliability.
  • Updated openapi file to “3.4.2” version.

Installation

  1. Add the package dependency to your Package.swift file:
dependencies: [
.package(url: "https://github.com/LLCFreedom-Space/fs-app-store-connect-client", from: "1.0.2")
]
  1. Import the library in your Swift code:
import AppStoreConnectClient

Usage

Here’s an example of how to use the AppStoreConnectClient to fetch information about list of your apps in App Store Connect:

let credentials = Credentials(
    issuerId: "<ISSUER_ID>"
    keyId: "<KEY_ID>"
    privateKey:
        """
        -----BEGIN PRIVATE KEY-----
                PRIVATE KEY
        -----END PRIVATE KEY-----
        """,
    expireDuration: "<TIME_INTERVAL>"
    )
let client = try AppStoreConnectClient(with: credentials)
do {
let fetchedApps = try await client.fetchApps()
// ... access to properties of apps
} catch {
print("Error fetching: \(error)")
}

Here’s an example of how to use the AppStoreConnectClient to fetch information about versions of your app:

let credentials = Credentials(
    issuerId: "<ISSUER_ID>"
    keyId: "<KEY_ID>"
    privateKey:
        """
        -----BEGIN PRIVATE KEY-----
                PRIVATE KEY
        -----END PRIVATE KEY-----
        """,
    expireDuration: "<TIME_INTERVAL>"
    )
let client = try AppStoreConnectClient(with: credentials)
do {
let fetchedApps = try await client.fetchApps()
let apps = try await client.fetchApps()
guard let app = apps.first(where: { $0.bundleId == "your.bundle.id" }) else {
        throw AppStoreConnectError.invalidBundleId
    }
let releases = try await client.fetchVersions(for: app)
// ... access to properties of apps
} catch {
print("Error fetching: \(error)")
}

Implemented Endpoints

To enable automatic code generation, add the Web Service Endpoint to the openapi-generator-config.yaml file."
Currently, the following endpoints are implemented:
- v1/apps
- v1/apps/{id}/appStoreVersions
- v1/builds
- v1/builds/{id}/preReleaseVersion

Contributions

We welcome contributions to this project! Please feel free to open issues or pull requests to help improve the package.

Links

LLC Freedom Space – @LLCFreedomSpace[email protected]

Distributed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3. See LICENSE.md for more information.

GitHub