A Swift package for the Deepgram API, generated from Deepgram's OpenAPI
specification with swift-openapi-generator.
- Swift 5.9 or later
- macOS 13, iOS 16, tvOS 16, or watchOS 9
Add the package to Package.swift:
.package(url: "https://github.com/atacan/SwiftDeepgram.git", branch: "main")Then add the product you need to your target:
.product(name: "Deepgram", package: "SwiftDeepgram")The package also exposes DeepgramTypes separately for projects that only need
the generated OpenAPI types.
Create a generated client with the provided authentication middleware:
import Deepgram
import DeepgramTypes
import OpenAPIAsyncHTTPClient
import OpenAPIRuntime
let client = Client(
serverURL: try Servers.Server1.url(),
configuration: Configuration(dateTranscoder: .iso8601WithFractionalSeconds),
transport: AsyncHTTPClientTransport(),
middlewares: [
AuthenticationMiddleware(apiKey: "<deepgram-api-key>")
]
)Do not commit API keys or local environment files. For local development, keep
credentials in an ignored .env file or your shell environment.
Generated Swift sources are checked in. To regenerate them from the transformed OpenAPI specification, run:
make regenerateBuild the package with:
swift buildThis repository uses Gitleaks and TruffleHog for local and CI secret scanning. Run the configured hooks locally with:
pre-commit run --all-filesMIT. See LICENSE.