A Swift package for iOS, macOS, tvOS, and watchOS. It installs an uncaught-exception handler and auto-attaches device metadata, with a manual `notify` for handled errors.
Add the package in Package.swift (or Xcode → File → Add Packages…) and add "Errorgap" to your target's dependencies:
.package(url: "https://github.com/errorgaphq/errorgap-swift.git", from: "0.2.0")In your app's launch path:
import Errorgap
Errorgap.initialize(ErrorgapConfiguration(
endpoint: "https://your-endpoint",
projectSlug: "your-project",
apiKey: ProcessInfo.processInfo.environment["ERRORGAP_API_KEY"],
release: Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
))By default the SDK installs NSSetUncaughtExceptionHandler and attaches device metadata (os_name, app_version, device_model, …). Pass captureGlobals: false to skip the global hook.
Errorgap.notify(NSError(domain: "ErrorgapTest", code: 0, userInfo: [
NSLocalizedDescriptionKey: "Errorgap test error"
]))Confirm your key and endpoint reach errorgap before wiring anything else — send one event straight to the ingestion API:
curl -sS -X POST "$ERRORGAP_ENDPOINT/api/projects/$ERRORGAP_PROJECT_SLUG/notices" \
-H "content-type: application/json" \
-H "x-errorgap-project-key: $ERRORGAP_API_KEY" \
-d '{"errors":[{"type":"ErrorgapInstallTest","message":"Errorgap install verification"}]}'A 201 with a group_id means ingestion works (202 = received but sampled; 401 = wrong key). Then trigger the test error above through the SDK. Your onboarding screen's Verify step checks the stack off automatically once the first event lands — it polls every three seconds.
Next: the full ingestion API, or browse every SDK.