The Dart & Flutter SDK
BetaYour 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.
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
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
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 WebView | You 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 package | The 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
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. |
| history | List<Message>, read-only, oldest first. |
| clear() | Forgets the local history. The server keeps its own record. |
| visitorId | Who this conversation belongs to. |
Where it differs from the browser SDK
| Visitor id | Required. There is no localStorage to keep one in, so you pass a stable id yourself. |
|---|---|
| History | Kept 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. |
| Cancelling | Cancel the StreamSubscription. There is no AbortSignal and no aborted code is thrown. |
| Event fields | chunk, not text — the raw frame's name. No agentSwitch getter. |
| Error codes | camelCase enum values: rateLimited, not rate_limited. secretKey, not secret_key_in_browser. |
What it does not do, yet
| Human handoff | The endpoints exist and the browser SDK calls them. Not wired up here. |
|---|---|
| Rating an answer | Same — the endpoint is there, the method is not. messageId arrives so you can keep it for when it is. |
| Theme | No theme() helper. The colours are strings on AgentConfig — see Agent settings for converting them. |
| Flutter widgets | A separate package, once this one is settled. |