https://github.com/ctrl-hub/sdk.swift
An SDK for interacting with the Ctrl Hub API in Swift
https://github.com/ctrl-hub/sdk.swift
sdk sdk-ios swift
Last synced: 2 months ago
JSON representation
An SDK for interacting with the Ctrl Hub API in Swift
- Host: GitHub
- URL: https://github.com/ctrl-hub/sdk.swift
- Owner: ctrl-hub
- License: mit
- Created: 2024-10-27T21:58:55.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-22T18:20:36.000Z (3 months ago)
- Last Synced: 2025-03-22T18:28:20.229Z (3 months ago)
- Topics: sdk, sdk-ios, swift
- Language: Swift
- Homepage: https://docs.ctrl-hub.com/sdk/swift
- Size: 99.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# CtrlHub
[](https://swiftpackageindex.com/ctrl-hub/sdk.swift)
[](https://swiftpackageindex.com/ctrl-hub/sdk.swift)This swift package is an SDK for the [Ctrl Hub API](https://docs.ctrl-hub.com/api-reference).
## Installation
Add the package with your package manager using `https://github.com/ctrl-hub/sdk.swift`
Then import the package into your bundle:
```swift
import CtrlHub
```## Getting Started
The SDK uses a `.plist` configuration file called `CtrlHubConfig.plist` to collect all of the variables required to connect to the platform which you should add to to the root of your own project when integrating the SDK.
```xml
authDomain
https://auth.ctrl-hub.com
apiDomain
https://api.ctrl-hub.com```
To use the SDK, you need to import the package before calling any methods:
```swift
import CtrlHub// Read the configuration from the CtrlHubConfig.plist in your app bundle:
if let configuration = CtrlHub.Config() {
CtrlHub.config = configuration
} else {
// there are errors in the config file
}// Make requests to Ctrl Hub via the SDK:
do {
let orgs = try await CtrlHub.Organisations.shared.Get()
} catch let error as CtrlHub.APIError {
// handle the error
}
```