gtateth_flutter_sdk 0.1.2 copy "gtateth_flutter_sdk: ^0.1.2" to clipboard
gtateth_flutter_sdk: ^0.1.2 copied to clipboard

Official Flutter SDK and native UI components for g-tateth chat widget integration.

gtateth_flutter_sdk #

Native Flutter SDK and UI components for integrating g-tateth chat on mobile.

Features #

  • Typed client for /api/widget/* endpoints
  • Session initialization and token handling
  • Send/fetch messages
  • Online agents and settings fetch
  • Conversation lifecycle helpers
  • Socket.IO realtime support
  • Ready-to-use native Flutter chat widget

Install #

Add to your app pubspec.yaml:

dependencies:
  gtateth_flutter_sdk: ^0.1.1

For local development in this monorepo, you can still use a path dependency:

dependencies:
  gtateth_flutter_sdk:
    path: ../sdks/flutter

Quick Start #

import 'package:flutter/material.dart';
import 'package:gtateth_flutter_sdk/gtateth_flutter_sdk.dart';

class SupportScreen extends StatelessWidget {
  const SupportScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Support')),
      body: Padding(
        padding: const EdgeInsets.only(bottom: 20.0),
        child: GtatethChatWidget(
          config: const WidgetClientConfig(
            baseUrl: 'https://api.g-tateth.com',
            tenantDomain: 'your-domain',
          ),
          customer: ChatCustomer(
            firstName: currentUser.firstName,
            lastName:  currentUser.lastName,
            email: currentUser.email,
          ),
        ),
      ),
    );
  }
}

Low-level API usage #

final client = WidgetClient(
  config: const WidgetClientConfig(
    baseUrl: 'https://api.g-tateth.com',
    tenantId: 'YOUR_TENANT_ID',
  ),
);

final session = await client.initSession(sessionId: 'device-session-123');
final messages = await client.getMessages(
  conversationId: session.conversationId,
  bearerToken: session.token,
);

await client.sendMessage(
  conversationId: session.conversationId,
  text: 'Hello from Flutter',
  bearerToken: session.token,
);

Realtime example #

final realtime = WidgetRealtimeClient(
  RealtimeConfig(
    baseUrl: 'https://api.g-tateth.com',
    token: session.token,
    conversationId: session.conversationId,
  ),
);

await realtime.connect();
realtime.messages.listen((message) {
  debugPrint('new-message: ${message.text}');
});

Notes #

  • baseUrl should point to your backend API host, for example https://api.g-tateth.com.
  • If your backend identifies tenants by domain, provide tenantDomain; otherwise use tenantId.
  • The SDK is designed to work with the existing widget backend endpoints in this repository.
  • customer should be the signed-in end user in the client app (not your support agent record).

Local Testing #

Use this SDK from your own Flutter app and point it to your local backend.

  1. Set:
  • baseUrl to your local API URL
  • tenantDomain (or tenantId) to a valid tenant
  1. Run your app on emulator/device and verify:
  • App loads chat UI
  • Session initializes
  • You can send a message
  • Incoming agent/chatbot message appears in real-time
1
likes
0
points
39
downloads

Publisher

unverified uploader

Weekly Downloads

Official Flutter SDK and native UI components for g-tateth chat widget integration.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, http, socket_io_client, uuid

More

Packages that depend on gtateth_flutter_sdk