Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
petrpavlik authored Oct 1, 2024
1 parent 27c71c2 commit 6ffaacb
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,23 @@ SDK documentation can be found [here](https://swiftpackageindex.com/indiepitcher

The SDK is designed to work with any framework built on top of Swift Nio - Vapor, Hummingbird, or AWS Lamda is supported.

Add the dependency to your `Package.swift` file
```
1) Add the dependency to your `Package.swift` file
```swift
.package(url: "https://github.com/IndiePitcher/indiepitcher-swift.git", from: "1.0.0"),
```

Add IndiePitcher to appropriate target(s) of your project
```
2) Add IndiePitcher to appropriate target(s) of your project
```swift
.product(name: "IndiePitcherSwift", package: "indiepitcher-swift")
```

You can also use the CLI instead
```bash
swift package add-dependency https://github.com/IndiePitcher/indiepitcher-swift.git --from 1.0.0
swift package add-target-dependency IndiePitcherSwift --package indiepitcher-swift MyTarget
```


**Using the SDK:**
- First, you need to get an API key. Go to the IndiePitcher dashboard, create a project, and generate a public API key.
- Add the key to your `.env` file. Following examples will assume that you've added the key under `IP_SECRET_API_KEY` key.
Expand Down Expand Up @@ -73,7 +81,7 @@ struct MyLambda: SimpleLambdaHandler {

func handle(_ event: String, context: LambdaContext) async throws -> String {

let indiePitcher = IndiePitcher(client: .shared, apiKey: indiePitcherApiKey)
let indiePitcher = IndiePitcher(apiKey: indiePitcherApiKey)

let emailBody = """
This is an email sent from a **AWS Lambda function**!
Expand Down

0 comments on commit 6ffaacb

Please sign in to comment.