Brand Concierge API reference (iOS)

wrap

Wraps a SwiftUI view with the Brand Concierge overlay and optional floating button. Call this once at the app's root to enable the chat overlay across the entire view hierarchy.

data-variant=info
data-slots=text
The surfaces, title, subtitle, and handleLink parameters on wrap(...) only apply when chat is triggered via the built-in floating button. When chat is triggered via Concierge.show(...) or Concierge.present(on:...), the values passed to those APIs are used instead.

Syntax

static func wrap<Content: View>(
    _ content: Content,
    surfaces: [String] = [],
    title: String? = nil,
    subtitle: String? = nil,
    hideButton: Bool = false,
    handleLink: ((URL) -> Bool)? = nil
) -> some View

Parameters

Example

@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            Concierge.wrap(
                ContentView(),
                surfaces: ["web://example.com/your-surface.html"]
            )
        }
    }
}

show

Opens the chat overlay for a new chat session. Requires the view hierarchy to have been wrapped with Concierge.wrap(...) first.

Syntax

static func show(
    surfaces: [String],
    title: String? = nil,
    subtitle: String? = nil,
    speechCapturer: SpeechCapturing? = nil,
    textSpeaker: TextSpeaking? = nil,
    handleLink: ((URL) -> Bool)? = nil
)

Parameters

Example

Button("Chat") {
    Concierge.show(
        surfaces: ["web://example.com/your-surface.html"],
        title: "Concierge",
        subtitle: "Powered by Adobe"
    )
}

hide

Dismisses the currently presented chat overlay.

Syntax

static func hide()

Example

Concierge.hide()

present

Embeds the chat UI as a child view controller into an existing UIViewController. Use this for UIKit-based apps.

Syntax

static func present(
    on presentingViewController: UIViewController,
    surfaces: [String],
    title: String? = nil,
    subtitle: String? = nil,
    speechCapturer: SpeechCapturing? = nil,
    textSpeaker: TextSpeaking? = nil,
    handleLink: ((URL) -> Bool)? = nil
)

Parameters

Example

import AEPBrandConcierge

final class MyViewController: UIViewController {
    @objc private func openChat() {
        Concierge.present(
            on: self,
            surfaces: ["web://example.com/your-surface.html"],
            title: "Concierge",
            subtitle: "Powered by Adobe"
        )
    }
}

setAuthTokenProvider

Registers the provider the SDK consults for an auth token before every chat and feedback turn. Lets a host app attach its own opaque, app-minted authentication token to Brand Concierge conversation turns.

data-variant=info
data-slots=text
Supply only the opaque, app-minted token your backend expects — never a raw identity-provider (e.g. Auth0) token. The SDK attaches it verbatim as its own request-body field, never as an Authorization header and never merged into the identity payload, and never inspects or logs it.

Syntax

static func setAuthTokenProvider(
    timeout: TimeInterval = 3,
    _ provider: (@Sendable () async -> String?)?
)

Parameters

Example

Concierge.setAuthTokenProvider { [weak tokenCache] in
    await tokenCache?.freshToken()
}

sendDataHandoff

Hands data that didn't originate from something the user typed or said in chat (for example, the result of a native checkout flow) to the agent pipeline (Brand Concierge / Product Advisor). Requires an active Concierge chat session. See Data handoff in the implementation guide for details.

Syntax

static func sendDataHandoff(
    routingHint: String = "",
    xdmFields: [String: Any],
    localMessage: String? = nil,
    completion: (@MainActor (Result<Void, ConciergeDataHandoffError>) -> Void)? = nil
)

Parameters

Example

Concierge.sendDataHandoff(
    routingHint: "successful-checkout",
    xdmFields: ["commerce": ["order": ["purchaseID": orderId]]],
    localMessage: "Your order is confirmed!"
) { result in
    if case .failure(let error) = result {
        analytics.track("concierge_handoff_failed", ["code": error.code])
    }
}

ConciergeDataHandoffError

The typed error passed to the sendDataHandoff completion on failure. Each case exposes a stable code string intended for analytics and crash reporting.

Error
code
missingEventData
missing_event_data
emptyXdmFields
empty_xdm_fields
invalidXdmFieldValue
invalid_xdm_field_value
reservedKeyCollision
reserved_key_collision
noActiveSession
no_active_session
chatInProgress
chat_in_progress
deliveryFailed(String?)
delivery_failed
emptyResponse
empty_response
deliveryTimeout
delivery_timeout
noResponse
no_response

See the error table in the implementation guide for the meaning of each case.

ConciergeThemeLoader.load

Loads a ConciergeTheme from a JSON file in a bundle. Returns nil if the file cannot be found or parsed.

Syntax

public static func load(from filename: String, in bundle: Bundle = .main) -> ConciergeTheme?

Parameters

Example

let theme = ConciergeThemeLoader.load(from: "my-theme", in: .main)
    ?? ConciergeThemeLoader.default()

ConciergeThemeLoader.default

Returns the built-in default ConciergeTheme.

Syntax

public static func `default`() -> ConciergeTheme

Example

let theme = ConciergeThemeLoader.default()