# Swift setup — BugTapeCore alpha

Capture handled errors and user reports on iOS15+ and macOS12+. The source package requires Swift5.9+, has no third-party dependency and includes its Apache-2.0 license and privacy manifest.

1. Open **Setup** in your BugTape console. Select a project and generate a dedicated public client capture key.
2. Choose **iOS (Swift)**. Download BugTapeCore, extract it and add the folder using **File → Add Package Dependencies → Add Local** in Xcode. Link the BugTapeCore product to your app target. Keep the extracted folder with your project for your team and build runner.
3. Select **Prepare this Swift installation** and create an installation. Copy the generated snippet into your app. It includes the enrolled application and installation UUIDs. A workspace admin or manager must prepare the installation.
4. Call `startBugTape(diagnosticConsent:)` from an async context after your app obtains diagnostic consent. Keep the returned client. Call `report(...)` for a user report or `capture(error, screen:fields:)` for a handled error. The snippet shows a first-report example.
5. Return to Setup. **Capture received for this installation** links to the accepted occurrence. The receipt states Swift · iOS or Swift · macOS. A Mac receipt does not prove an iPhone upload. A console sample, report count or another installation cannot complete this check.

The console shows full keys only after generation. A reload restores enrolled IDs but shows a placeholder key; use your saved capture key or generate a replacement. No agent PAT, CI signing key or database credential belongs in your app.

## Download without console access

The [current release manifest](https://app.bugtape.ai/sdk/swift/manifest.json) names a versioned ZIP with its SHA-256 and exact file inventory. Resolve its `archiveUrl` relative to `/sdk/swift/`. Compare the downloaded bytes with that digest before adding the package. Retained version manifests use `/sdk/swift/<version>.json`. Published ZIP URLs keep their original bytes across releases.

This is a downloadable local Swift package. A ZIP URL is not a remote Git package URL and cannot be pasted into Xcode's repository field. No npm package or private repository access is needed. The included README gives a plain SwiftPM local-path recipe and the complete core API boundaries.

## What the alpha records

Handled errors, user reports, explicit screen breadcrumbs and optional network metadata hooks are supported. It records no DOM, video, ten-minute replay, screenshot, microphone or fatal crash. It performs no swizzling or global handler installation. Native symbolication and device fix verification remain unavailable.

`start(consent: false)` fails closed. `stop()` stops new collection and delivery while keeping queued reports; `revokeConsent()` also purges this client's local queue. Neither removes data already accepted by the server. An in-flight request can reach the server before cancellation. Keep private data out of fields and inspect your app's redaction and final privacy disclosures.

A persisted queue survives normal relaunch and retries with bounded backoff while the app runs. `flush()` attempts due work; queued does not mean delivered. Check `status().lastAcceptedCaptureID` against the returned capture UUID. iOS can suspend the app, so background delivery is not guaranteed. Files use OS protection and are excluded from backup; this is not end-to-end encryption.

Application and installation UUIDs identify a managed capture destination. A shared snippet uses the same installation UUID across its copies; it does not identify each physical device. The receipt confirms delivery, not current connectivity, a verified binary or a fixed bug.
