The official Swift SDK for the S.EE API. It uses Swift Concurrency and URLSession with no third-party dependencies.
Supported platforms:
- iOS 15 or later
- macOS 12 or later
- Swift 6 or later
Add the package in Xcode, or declare it in Package.swift:
dependencies: [
.package(url: "https://github.com/sdotee/sdk.swift", from: "1.0.0")
]Add the see-sdk product to your target, then import the SeeSDK module.
import SeeSDK
let client = SEEClient(configuration: .init(apiKey: "your-api-key"))Use a custom endpoint when needed:
let client = SEEClient(configuration: .init(
apiKey: "your-api-key",
baseURL: URL(string: "https://example.com/api/v1/")!
))The default API base URL is https://s.ee/api/v1/.
let shortURL = try await client.shortURLs.create(.init(
domain: "s.ee",
targetURL: "https://example.com/long-path",
customSlug: "example",
title: "Example"
))
let history = try await client.shortURLs.history(page: 1)
let statistics = try await client.shortURLs.visitStatistics(
domain: "s.ee",
slug: shortURL.slug,
period: .monthly
)Upload a small file with multipart form data:
let data = try Data(contentsOf: fileURL)
let file = try await client.files.upload(
data: data,
filename: fileURL.lastPathComponent,
mimeType: "application/pdf"
)Create and complete a TUS large-file upload:
let session = try await client.files.createLargeUpload(.init(
fileName: "archive.zip",
fileSize: Int64(data.count),
mimeType: "application/zip"
))
if !session.fastUpload, let uploadID = session.uploadID {
var offset: Int64 = 0
for chunk in chunks {
offset = try await client.files.uploadChunk(
uploadID: uploadID,
data: chunk,
offset: offset
)
}
let result = try await client.files.completeLargeUpload(uploadID: uploadID)
}client.shortURLs: short URLs, domains, history, and visit statisticsclient.files: multipart upload, TUS upload, history, deletion, and private download URLsclient.texts: text sharing and historyclient.qrCodes: QR code creation and historyclient.bioPages: bio page management and historyclient.account: tags, usage, and token validation
All public request and response models conform to Codable and Sendable. Transport and API failures are reported as SEEError.