Skip to content
Quickstart

Get started

Quickstart

Install BTXClientKit, enable the features you need, and identify a customer only when the experience requires it.

Before you start

You need an iOS 17 or newer app and a BTX publishable client key. A publishable key is designed for the client application; never place server credentials in the app bundle.

01

Integrate BTX

  1. 01

    Add the package

    In Xcode, choose File → Add Package Dependencies…, enter https://github.com/secondcontext/btx-ios-sdk.git, and add the BTXClientKit product to your app target.

  2. 02

    Configure once

    Call BTX.configure(...) during app startup. Enable only the capabilities your app is ready to use.

    App startup
    import BTXClientKit
    
    BTX.configure(
        BTXConfiguration(
            publishableClientKey: "cfk_...",
            features: [.messenger]
        )
    )
  3. 03

    Identify the signed-in customer

    Use the stable identifier your own product already trusts.

    Authenticated session
    BTX.identify(
        BTXCustomer(
            externalID: currentUser.id,
            name: currentUser.name,
            email: currentUser.email
        )
    )
  4. 04

    Open Customer Messenger

    Connect your own Help, Support, or Messages button to the messenger facade.

    Button action
    BTX.messenger.present()
02

Verify the integration

  1. Run the app, sign in with a test customer, and open Customer Messenger.
  2. Send a message and find the thread in the same BTX project.
  3. Send an operator reply and confirm it appears in the app.

Foreground messaging works without APNs. Add push notifications when customers need replies while the app is inactive.

03

Add the next feature