Quickstart
iOS SDK

iOS SDK Quickstart

Install the Gleam Swift package, configure the SDK, start the session, and present the Portal from SwiftUI or UIKit.

Use An AI Agent First

Using Codex, Cursor, Claude Code, or another coding agent? Start with the AI Agent Prompt page and let the agent add Gleam to your app.

Requirements

The Gleam iOS SDK is distributed as a Swift Package and supports iOS 15 or later. The public product target is named GleamSDK.

RequirementValue
Package URLhttps://github.com/gleamland/gleam-ios-sdk.git
Minimum iOSiOS 15

Install With Swift Package Manager

In Xcode, open File -> Add Package Dependencies, paste the package URL, and link the GleamSDK product to your app target.

Package URL

https://github.com/gleamland/gleam-ios-sdk.git

Configure And Start

Initialize the SDK once during application startup. The project ID and SDK key are client-safe values from Settings -> Integrations in the Gleam dashboard.

Call start() before presenting Portal UI. It resolves the hosted Portal URL, confirms capabilities, and prepares the WebView path used by the SDK.

Application startup

Choose the app lifecycle your iOS app already uses.

Configure once in the App initializer, then start the SDK session asynchronously.
import SwiftUI
import GleamSDK

@main
struct MyApp: App {
  init() {
    do {
      try Gleam.shared.configure(
        GleamConfiguration(
          projectId: "YOUR_PROJECT_ID",
          apiKey: "YOUR_GLEAM_SDK_KEY"
        )
      )

      #if DEBUG
      Gleam.shared.setLogLevel(.debug)
      #endif

      Task {
        try await Gleam.shared.start()
      }
    } catch {
      assertionFailure("Failed to configure Gleam: \(error)")
    }
  }

  var body: some Scene {
    WindowGroup {
      ContentView()
    }
  }
}

Present The Portal

Use the SwiftUI full-screen view for a native presentation, or call the UIKit convenience methods from an existing view controller.

Portal presentation

Use the same project configuration; only the presentation layer changes.

Present the hosted Portal with a full-screen SwiftUI cover.
import SwiftUI
import GleamSDK

struct ContentView: View {
  @State private var showFeedback = false

  var body: some View {
    Button("Send Feedback") {
      showFeedback = true
    }
    .fullScreenCover(isPresented: $showFeedback) {
      GleamPortalFullScreenView(section: .feedback)
    }
  }
}

Next Steps