Skip to content

Commit

Permalink
chore: add swift sdk readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sashatalalasha committed Feb 5, 2024
1 parent 28621e1 commit 97d0ccb
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions contrib/clients/swift/README.md
Original file line number Diff line number Diff line change
@@ -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)
```

0 comments on commit 97d0ccb

Please sign in to comment.