Skip to main content

Before you install

You need iOS 14 or later, Swift 5.9 or later, and Swift Package Manager. In Glean Feed, open Settings → Connections → iOS SDK as an Owner or Admin and copy the workspace ID and workspace slug. Both are safe to ship in your app; neither is a secret.

Add the package

In Xcode: File → Add Package Dependencies…, then paste:
Choose Exact Version and enter 0.2.1. The corresponding Git tag is v0.2.1. If you manage dependencies in Package.swift, add:

Initialize once

Call setup once, early — in your SwiftUI App initializer or application(_:didFinishLaunchingWithOptions:):
Use a unique, lowercase reverse-domain callback scheme. Register the exact same value in your app target under Info → URL Types. This enables customers to create an account or sign in from the portal with magic link or Google. If your app always calls identify, you may omit callbackURLScheme.
For a local dev stack, pass environment: .custom(baseURL: URL(string: "http://localhost:3000")!). It defaults to .production.

Present a view

SwiftUI

UIKit

Run the app and open feedback. You should see the expected workspace’s portal in a native sheet with a drag handle. The workspace header stays in place while the content scrolls, and you can swipe down to dismiss the sheet. This first check works anonymously; identity is the next step.

Next steps