https://github.com/telemetrydeck/brevo-kit
Swift Client for Brevo
https://github.com/telemetrydeck/brevo-kit
brevo email marketing sdk sdk-swift sendinblue swift vapor
Last synced: 12 months ago
JSON representation
Swift Client for Brevo
- Host: GitHub
- URL: https://github.com/telemetrydeck/brevo-kit
- Owner: TelemetryDeck
- License: bsd-3-clause
- Created: 2025-06-19T09:34:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-27T13:39:28.000Z (12 months ago)
- Last Synced: 2025-06-27T14:33:29.458Z (12 months ago)
- Topics: brevo, email, marketing, sdk, sdk-swift, sendinblue, swift, vapor
- Language: Swift
- Homepage:
- Size: 439 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# brevo-kit
Swift Vapor SDK for Brevo
Generated from the [Brevo API OpenAPI specification](https://api.brevo.com/v3/swagger_definition_v3.yml)
using [Swift OpenAPI Generator](https://github.com/apple/swift-openapi-generator).
See the [Brevo API docs](https://developers.brevo.com/docs/getting-started) for more information on how to use the API.
## Installation
Add the package dependency in your `Package.swift`:
```swift
.package(url: "https://github.com/telemetryDeck/brevo-kit", from: "1.0.0"),
```
Next, in your target, add `BrevoKit` to your dependencies:
```swift
.target(name: "MyTarget", dependencies: [
.product(name: "BrevoKit", package: "brevo-kit"),
]),
```
## Setup
Get an API key from your Brevo account here: https://app.brevo.com/settings/keys/api
Init with API Key:
```swift
let brevo: Brevo = try Brevo(apiKey: "xkeysib-...", sandbox: false)
```
TODO: Setup with Vapor.
## Usage
Send an email with defined content:
```swift
try await brevo.email.send(
from: .init(email: "root@eruditorium.org", name: "Enoch Root"),
to: [.init(email: "hello@example.com")],
subject: "Hello World",
htmlContent: nil,
textContent: "Hello World!"
)
```
Send an email with a template:
```swift
try await brevo.email.send(
to: [.init(email: "hello@example.com")],
templateID: 1,
parameters: ["name": "Daniel"],
tags: ["test", "brevo-kit"]
)
```
## Development
To update the generated code from the OpenAPI specification, you can use the generate-code-from-openapi plugin
provided by Apple. Download a new version of the
[Brevo API OpenAPI specification](https://api.brevo.com/v3/swagger_definition_v3.yml), place it into `openapi.yml`,
and run the following command:
```
swift package plugin generate-code-from-openapi --target BrevoKit
```