m1guelpf/swift-standard-webhooks
A Swift implementation of the [Standard Webhooks specification](https://www.standardwebhooks.com/).
Installation
<details>
<summary> Swift Package Manager </summary>
Add the following to your Package.swift:
dependencies: [
.package(url: "https://github.com/m1guelpf/swift-standard-webhooks.git", .branch("main"))
]</details> <details>
<summary>Installing through XCode</summary>
- File > Swift Packages > Add Package Dependency
- Add https://github.com/m1guelpf/swift-standard-webhooks.git
- Select "Branch" with "main"
</details>
<details>
<summary>CocoaPods</summary>
Ask ChatGPT to help you migrate away from CocoaPods.
</details>
Usage
Verifying a webhook payload:
import StandardWebhooks
let webhook = Webhook(secret: base64_secret)!
try webhook.verify(payload: webhook_payload, headers: webhook_headers);Signing a webhook payload:
import StandardWebhooks
let webhook = Webhook(secret: base64_secret)!
try webhook.sign(id: message_id, payload: webhook_payload);License
This project is licensed under the MIT License - see the LICENSE file for details.
Package Metadata
Repository: m1guelpf/swift-standard-webhooks
Default branch: main
README: README.md