Docs

Install on iOS

A Swift package with a SwiftUI chat screen.

Quickest way: one command

npx @octokan/cli init app_xxxxxxxxxxxx https://YOUR-BACKEND

Run it from your project's folder (it needs Node.js). It adds Octokan.configure to your App struct or AppDelegate. Adding the package in Xcode (File > Add Package Dependencies) is the one step it can't do for you, and it prints the exact URL. Your app key and backend URL are on the Install page of the dashboard. The manual steps below are exactly what it does.

OctokanSDK needs iOS 15 or later and has no third-party dependencies. It lives in sdks/ios of the octokan repository.

1. Add the package

In Xcode choose File > Add Package Dependencies, click Add Local, and pick the sdks/ios folder. To install from a URL, publish that folder as its own repository (git subtree split) and add that URL instead.

2. Configure once

import OctokanSDK

@main
struct MyApp: App {
    init() {
        Octokan.configure(appId: "app_xxxxxxxxxxxx", baseURL: URL(string: "https://YOUR-BACKEND")!)
    }
    var body: some Scene { WindowGroup { ContentView() } }
}

Nothing is sent or stored until the person opens the chat.

3. Show the chat

// SwiftUI
OctokanChatButton("Chat with us")

// or embed the screen yourself
OctokanChatView()

// UIKit, or any custom button
Octokan.presentChat()

Know who's writing

Octokan.identify(id: user.id, email: user.email, name: user.name)

// on sign-out
Octokan.reset()

Messages queue on the device while offline and send automatically. Replies appear within a few seconds while the chat is open.

Privacy

The SDK stores one random token (and any unsent messages) in UserDefaults. Octokan.deleteMyData() erases the person's chat from octokan and the device.

NextInstall on Android→