Skip to content

treastrain/AppStoreConnectWebhook

Repository files navigation

AppStoreConnectWebhook

Type definitions for App Store Connect webhook notification payloads in Swift.

MIT License Platform: macOS|Linux|Windows Swift: 6.1 Swift Package Manager compatible
X (formerly Twitter): @treastrain Swift Build & Test

Usage

import AppStoreConnectWebhook
import Foundation

let payloadJSON = """
    {
        "data": {
            "type": "webhookPingCreated",
            "id": "01234567-abcd-8901-dcba-987654321012",
            "version": 1,
            "attributes": {
                "timestamp": "2025-06-09T10:09:30.123456789Z"
            }
        }
    }
    """

let payload = try AppStoreConnectWebhookPayload(json: payloadJSON)
switch payload.data {
case .webhookPingCreated(let webhookPingCreated):
    webhookPingCreated.id  // "01234567-abcd-8901-dcba-987654321012"
    webhookPingCreated.attributes.timestamp  // 2025-06-09T10:09:30.123Z
// ...
}

How to add to your project

Package dependencies

.package(url: "https://github.com/treastrain/AppStoreConnectWebhook", branch: "main"),

Target dependencies

.product(name: "AppStoreConnectWebhook", package: "AppStoreConnectWebhook"),

License

MIT

About

Type definitions for App Store Connect webhook notification payloads in Swift.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages