The Dart & Flutter SDK

Beta

Your agent in a mobile app, with the interface you already designed.

WarningNot on pub.dev yet — and not yet run

The package is written and the surface below is the one it has. It is not published, so there is nothing to add to a pubspec.yaml today.

It was also written without a Dart toolchain to hand: it has not yet been compiled or had its tests run. Treat it as a careful draft until it has.

Three calls

Harbor & Pine’s app has a “Help” tab. This is everything it needs from Tigerbase — the same three steps as the browser SDK, in Dart.

lib/help_tab.dart
final tigerbase = Tigerbase(key: 'tb_your_key_here');

final agent = await tigerbase.config();
final chat = tigerbase.conversation(visitorId: deviceId);

await for (final event in chat.ask('Do you deliver to Leeds?')) {
  if (event.chunk != null) setState(() => reply += event.chunk!);
}

How a turn travels

The package opens one streamed POST per question and hands you the frames as a Dart Stream.

Pure Dart, not a Flutter package

It depends on package:http and nothing else. No Flutter, which means it also runs in a Dart backend, a CLI, and — the one that matters day to day — a plain dart test with no device attached.

NoteWidgets are a layer on top

Ready-made chat widgets are planned as a separate tigerbase_flutter package that depends on this one. A transport that needs a widget tree is a transport you cannot test, and the test is the half that matters.

Or a WebView

Wrapping the web widget in a WebView is a legitimate answer and it is worth saying so before somebody spends a week on the wrong one.

Use a WebViewYou want the default chat and you want it today. You get the whole widget — greeting, handoff, templates, every setting — for a page of code, and it tracks our updates without a release.
Use this packageThe chat belongs inside your app's own design: your fonts, your navigation, your message bubbles. Or the conversation is not a chat screen at all — a support tab, a form that answers back, a voice flow.

A WebView also costs what a WebView costs: a second rendering engine, a different scroll feel, and your keyboard handling and its keyboard handling disagreeing on some devices. If the chat is a core part of your app rather than a help button, that bill comes due.

CarefulA native build sends no Origin header

The publishable key is guarded by the agent’s allowed domains, read from the request’s Origin or Referer. A Flutter web build sends one; an Android, iOS or desktop build does not, and the hosted API refuses a request with neither. Read Setup before you plan a release around this package.

The whole surface

Tigerbase

Tigerbase(key:, apiUrl:, client:)Throws TigerbaseError at once on an empty key or a tb_live_ key. client is an http.Client to use instead of a fresh one.
config()Future<AgentConfig> — the dashboard's settings, flat. Cached; a failure is not.
conversation(visitorId:, history:)Conversation — visitorId is required; history resumes a thread you saved.
close()Releases the HTTP client.

Conversation

ask(question)Stream<StreamEvent> — the answer as it arrives. Nothing is sent until you listen.
askOnce(question)Future<String> — the same turn, awaited whole.
historyList<Message>, read-only, oldest first.
clear()Forgets the local history. The server keeps its own record.
visitorIdWho this conversation belongs to.

Where it differs from the browser SDK

Visitor idRequired. There is no localStorage to keep one in, so you pass a stable id yourself.
HistoryKept in memory as chat.history and sent with each turn; the server uses its own record when it has one. The browser SDK sends only the new question.
CancellingCancel the StreamSubscription. There is no AbortSignal and no aborted code is thrown.
Event fieldschunk, not text — the raw frame's name. No agentSwitch getter.
Error codescamelCase enum values: rateLimited, not rate_limited. secretKey, not secret_key_in_browser.

What it does not do, yet

Human handoffThe endpoints exist and the browser SDK calls them. Not wired up here.
Rating an answerSame — the endpoint is there, the method is not. messageId arrives so you can keep it for when it is.
ThemeNo theme() helper. The colours are strings on AgentConfig — see Agent settings for converting them.
Flutter widgetsA separate package, once this one is settled.