searchSDK for Swift
Swift 6 · iOS 16+ · macOS 13+ · tvOS 16+ · watchOS 9+ · visionOS 1+. Normalized search through your application's HTTPS gateway.
On this page
Install from source
Package: SearchSDK, version 0.1.0-alpha.1. This is an alpha source/local-artifact installation. No public registry release or release tag is assumed.
git clone https://github.com/Belweave/searchSDK.git
cd searchSDK
# Record this revision with your application's dependency lock.
git rev-parse HEAD// In Package.swift, add the local checkout as a dependency:
.package(name: "SearchSDK", path: "/absolute/path/searchSDK")
// In your target's dependencies:
.product(name: "SearchSDK", package: "SearchSDK")The repository-root SwiftPM manifest exposes SearchSDK. Xcode can also consume the Git repository at a reviewed revision containing that manifest. No release tag is assumed; Linux and Windows are unsupported.
Call your application gateway
First deploy an application-owned gateway. searchsdk.dev hosts a demonstration playground and documentation MCP service; neither is an application gateway for these SDKs.
import SearchSDK
func searchExample(
endpoint: String,
applicationToken: @escaping @Sendable () async throws -> String?
) async throws {
let search = try SearchClient(
endpoint: endpoint,
applicationToken: applicationToken
)
let response = try await search.search(
SearchRequest(query: "SQLite write concurrency", limit: 3)
)
for result in response.results {
print(result.url, result.provenance.provider)
}
}Pass your exact application-owned HTTPS endpoint and a callback that resolves the current application token. Provider selection and provider keys belong on that server. Cancel the caller's Task to cancel search.
Supported surface and limits
Normalized search through your application's HTTPS gateway.
- Gateway search only. No provider-native operations or client-side provider retry/fallback/cache policy.
- Physical devices and every minimum OS runtime are not covered by the local verification.
Preserve result order, provider-native scores and source provenance. Unknown usage is not zero cost. Cancellation and deadlines cannot undo a request already accepted by a remote system or guarantee exactly-once effects.
Verify without provider keys
xcodebuild -version
swift test --package-path packages/swift --scratch-path .local/swift-build --jobs 2
sh packages/swift/Scripts/verify-consumer.sh .local/swift-consumer29 tests on macOS and an iOS simulator; tvOS, watchOS and visionOS simulator builds; extracted SwiftPM consumer.
These are deterministic contract and artifact checks. They do not establish live-provider or account-entitlement verification. Read the package README for precise commands, dependencies and runtime coverage.