Skip to main content

Prerequisites

Installation

The SDK ships as a Swift Package.
  1. File → Add Package Dependencies…
  2. Paste the repository URL:
  3. Choose version 0.1.0-beta.1 (or Up to Next Minor) and add the ChatbaseSDK library to your app target.
Then import it:
No Info.plist changes are needed. The SDK talks to https://www.chatbase.co over HTTPS, which iOS allows by default.

Quick Start

1

Get your Agent ID

  1. Go to the Chatbase Dashboard
  2. Select your AI agent
  3. Go to Settings → General
  4. Copy the Agent ID
2

Enable the iOS SDK channel

In the dashboard, go to Deploy → iOS SDK and enable the channel for your AI agent.
If the iOS SDK channel is not enabled, every SDK request fails with a 404 AGENT_NOT_FOUND error, even when the agent ID is correct.
3

Create a client

Create the client once and keep it around, in a view model, an app-level dependency, or a @State property. A new client starts anonymous, tied to a device ID that stays the same across launches. For configuration options, see ChatbaseClient.
4

Send your first message

See ChatResponse for every field on the response.
5

Continue the conversation

For UI code, use ConversationState instead. It keeps the conversation ID for you, along with the message list.
There is no close() or cleanup call. The client shuts down its network session when it goes out of scope.

Next Steps

Streaming

Stream replies with async/await and callbacks

SwiftUI

Ready-made state for chat screens

Client-Side Tools

Let the AI agent run functions on the device

ChatbaseClient

Initializer, properties, and methods