AI Prompt
AI Setup

AI Agent Prompt

Generate a scoped prompt for an AI coding agent to integrate the Gleam iOS SDK with the capabilities your app needs.

Generate The Prompt

Use this page when you want Codex, Cursor, Claude Code, or another coding agent to add the Gleam iOS SDK for you. The generator keeps the request limited to the supported v1 SDK surface and avoids unrelated management APIs or outbound webhook assumptions.

Choose your app stack and optional SDK capabilities, then copy the generated prompt into your coding agent inside the iOS app repository.

AI Agent integration prompt

Choose the app stack and optional SDK capabilities, then copy the prompt into your coding agent.

App stack

User access

Optional for apps with accounts

Generated prompt

2,208 chars

I am integrating the Gleam iOS SDK into an iOS app. Please implement the integration directly in this codebase.

Use only the supported Gleam SDK v1 surfaces needed for this integration: Portal WebView UI, anonymous sessions, signed identity, announcements, notification inbox, notification preferences, APNs device-token registration, logout unregister, and notification deep-link routing.

Package:
- Add Swift Package Manager dependency: https://github.com/gleamland/gleam-ios-sdk.git
- Link the product named GleamSDK to the app target.

Configuration:
- Use projectId: YOUR_PROJECT_ID
- Use apiKey: YOUR_GLEAM_SDK_KEY
- These are client-safe values from Gleam dashboard Settings -> Integrations.
- Call Gleam.shared.configure(...) once during application startup.
- Call try await Gleam.shared.start() before presenting Portal UI.

Host app style:
- Use SwiftUI as the host app style.
- Configure Gleam in the @main App initializer.
- Present the Portal with GleamPortalFullScreenView inside a fullScreenCover.

Selected capabilities:

User access:
- Use no-login anonymous Gleam sessions.
- Do not require users to sign in before they can open the Gleam Portal.
- Do not add signed identity code or a Gleam-specific sign-in screen.

Notifications and preferences:
- Add calls for fetchAnnouncements, fetchLatestAnnouncement, fetchNotifications, getNotificationPreferences, and setNotificationPreferences where appropriate.
- Use notification polling as a foreground catch-up path even if APNs is enabled.

Diagnostics:
- Handle invalid_sdk_key, portalNotReady, identity_not_configured, unauthorized, and server errors.
- Log statusCode and requestId from Gleam server errors.
- Do not swallow setup failures silently in development builds.

Implementation constraints:
- Do not invent unsupported Gleam APIs, REST endpoints, webhooks, MCP tools, or management APIs.
- Do not put server-only secrets, APNs .p8 keys, or identity signing secrets in client code.
- Keep the integration minimal, production-safe, and aligned with the app's existing Swift concurrency and navigation patterns.
- After implementation, show the exact files changed and any manual Xcode capability steps I still need to perform.

Review The Output

After the agent finishes, review the generated code the same way you would review a teammate's SDK integration. The prompt is intentionally specific, but your app still owns permission timing, navigation placement, and release validation.

Before merging

  • Confirm the app imports the GleamSDK product from Swift Package Manager and does not vendor copied SDK code.
  • Confirm projectId and apiKey come from the intended Gleam dashboard project.
  • Confirm signed identity tokens are generated on your backend, never in the iOS client.
  • Confirm APNs registration only runs after your app has notification permission and the SDK session is ready.
  • Run the app on a simulator or device and open the Portal entry point from the real navigation surface.

Continue In The Docs