2026-03-26 01:07:23 +00:00
|
|
|
# ``Client``
|
|
|
|
|
|
2026-10-25 17:52:37 +00:00
|
|
|
The App Store Connect API client.
|
2026-03-26 01:07:23 +00:00
|
|
|
|
|
|
|
|
## Overview
|
|
|
|
|
|
2026-10-25 17:52:37 +00:00
|
|
|
``Client`` implements every ``APIProtocol`` method by sending the request through its transport, after passing it through its middlewares.
|
2026-03-26 01:07:23 +00:00
|
|
|
|
2026-10-25 17:52:37 +00:00
|
|
|
Include ``BearerAuthMiddleware`` in `middlewares` to authenticate requests:
|
2026-03-26 01:07:23 +00:00
|
|
|
|
|
|
|
|
```swift
|
|
|
|
|
import ASConnectService
|
|
|
|
|
import OpenAPIURLSession
|
|
|
|
|
|
|
|
|
|
let client = Client(
|
2026-10-25 17:52:37 +00:00
|
|
|
serverURL: try Servers.Server1.url(),
|
2026-03-26 01:07:23 +00:00
|
|
|
transport: URLSessionTransport(),
|
|
|
|
|
middlewares: [
|
|
|
|
|
BearerAuthMiddleware(token: yourJWTToken)
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
```
|
|
|
|
|
|
2026-10-25 17:52:37 +00:00
|
|
|
Each method takes either a single `Input` value or its `path`, `query`, `headers`, and `body` as separate arguments:
|
2026-03-26 01:07:23 +00:00
|
|
|
|
|
|
|
|
```swift
|
2026-10-25 17:52:37 +00:00
|
|
|
let response = try await client.appsGetInstance(path: .init(id: appID))
|
2026-03-26 01:07:23 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Topics
|
|
|
|
|
|
|
|
|
|
### Creating a Client
|
|
|
|
|
|
|
|
|
|
- ``init(serverURL:configuration:transport:middlewares:)``
|