Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

iOS SDK

Installation

In Xcode: File → Add Package Dependencies, paste this URL:

https://github.com/scalekit-inc/scalekit-sdk-ios

Set version rule to from: "0.3.0", select your app target, then click Add Package.

0.3.0 Swift SPM iOS 15+
Initialize the client
import ScalekitAuth
@StateObject private var client = ScalekitClient(
environmentURL: "YOUR_ENV_URL", // e.g. acme.scalekit.cloud
clientId: "YOUR_CLIENT_ID", // starts with ntvc_
redirectScheme: "YOUR_BUNDLE_ID" // e.g. com.example.myapp
)
Authenticate and manage sessions
// Basic login
try await client.login()
// With organization routing (SSO)
try await client.login(options: .init(organizationId: "org_123456"))
// Access user information
if let user = client.credentials?.userInfo {
print(user.name) // "Jane Doe"
print(user.email) // "jane@acme.com"
}
// Refresh the access token before protected API calls (no-op if still valid)
try await client.renew()
let accessToken = client.credentials?.accessToken
// Logout
await client.logout()