diff --git a/README.md b/README.md index f098bfb..293f00a 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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**!