Swift SDK

Package: comprehendly-sdk-swift. Product ComprehendlyForms (iOS 16+, macOS 13+). Voice UI is iOS WKWebView.

Add the package

  1. Clone the repo (or add the GitHub URL once you depend on a tagged release).
  2. Xcode → Package Dependencies → add local package → library ComprehendlyForms.

Open Examples/Demo/ComprehendlyDemo.xcodeproj, pick a simulator, Run. Allowlist https://ios-demo.comprehendly.nz on the publishable key.

Client

import ComprehendlyForms

let client = ComprehendlyClient(publishableKey: "pk_test_…")
// default Origin: https://ios-demo.comprehendly.nz — must be on the key allowlist
try await client.exchange()
let page = try await client.pageGet(pageId)
ComprehendlyFormView(store: client.store)

let saved = try await client.submissionsSave(
  pageId: pageId,
  fieldValues: client.store.values
)

catalogList() returns gateway JSON. pageGet parses elements into ComprehendlyPage and loads the store.

Voice

let url = try client.voiceBridgeURL(pageId: pageId, mode: "assistant")
VoiceBridgeView(url: url, store: client.store)

Add NSMicrophoneUsageDescription to the host Info.plist. Do not implement Realtime in this package.

Origin header

URLSession does not send Origin unless you set it. Keep ComprehendlyClient.origin in sync with the key allowlist.