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.
Integrate BTX
- 01
Add the package
In Xcode, choose File → Add Package Dependencies…, enter
https://github.com/secondcontext/btx-ios-sdk.git, and add theBTXClientKitproduct to your app target. - 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] ) ) - 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 ) ) - 04
Open Customer Messenger
Connect your own Help, Support, or Messages button to the messenger facade.
Button action BTX.messenger.present()
Verify the integration
- Run the app, sign in with a test customer, and open Customer Messenger.
- Send a message and find the thread in the same BTX project.
- 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.