Skip to content
Scalekit Docs
Talk to an EngineerDashboard

iOS SDK

Install

GitHub

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

https://github.com/scalekit-inc/scalekit-sdk-ios
SwiftSPMiOS 15+

Initialize

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
)

Auth and 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()