-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28621e1
commit 97d0ccb
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
``` |