diff --git a/contrib/clients/swift/README.md b/contrib/clients/swift/README.md new file mode 100644 index 0000000000..4cebfc35fb --- /dev/null +++ b/contrib/clients/swift/README.md @@ -0,0 +1,45 @@ +# Ory Swift SDK + +Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. + + +This package is atomatically generated by [Swift OpenAPI Generator](https://github.com/apple/swift-openapi-generator) + +## Installation + +Add the package dependency in your Package.swift: + +```swift +.package(url: "https://github.com/ory/client-swift", from: "1.0.0"), +``` + +Next, in your target, add OryClient to your dependencies: + +```swift +.target(name: "MyTarget", dependencies: [ + .product(name: "OryCLient", package: "OryClient"), +]), +``` + + + +## Usage + +When creating an Ory client, use CustomDateTranscoder to support date with internet date time and fractional seconds. + +```swift +import OpenAPIRuntime +import OpenAPIURLSession +import Foundation + +let serverURL = URL(string: "https://{your-project-slug}.projects.oryapis.com") +let customDateTranscoder = CustomDateTranscoder() +let transport = URLSessionTransport() + +let oryClient = Client(serverURL: serverURL!, + configuration: Configuration(dateTranscoder: customDateTranscoder), + transport: transport) + +let response = try await oryClient.createNativeLoginFlow() +print(try response.ok) +``` \ No newline at end of file