Adovvy SDK (Flutter)

What you get

  • Simple API: initialize once, open chat from anywhere.
  • Full-screen chat UI: opens the chatbot in a full-screen route.
  • Close button support: the chatbot “X” requests closing the Flutter route.
  • Voice input support: handles microphone permission prompts (Android + iOS).

Installation

Install from pub.dev.

flutter pub add adovvy_sdk

Or add it manually in your app pubspec.yaml (package name is adovvy_sdk, all lowercase):

dependencies:
  adovvy_sdk: ^1.0.1

Use the latest version shown on pub.dev (the caret range above is just an example).

Quick start

Initialize once (e.g. in main.dart) and then open chat from any screen.

Do not hardcode chatbotId, servers, or script URLs in source control. Load them from your app’s secure configuration (remote config, encrypted storage, CI secrets, etc.). The snippet below uses compile-time --dart-define values so IDs/URLs are not embedded in the README or your repo as literals.

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

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await AdovvySdk.init(
    chatbotConfig: AdovvyChatbotConfig(
      chainlitServer: "https://......",
      chatbotId: "ac35.....",
      buttonColor: '#000000',
      loaderScriptUrl: "https://......",
      scripts: const [
        "https://.....",
      ],
    ),
  );

  runApp(const MyApp());
}

Open chat:

AdovvySdk.openChat(context);

Example button:

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

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

  @override
  Widget build(BuildContext context) {
    return FilledButton(
      onPressed: () => AdovvySdk.openChat(context),
      child: const Text('Chat with us'),
    );
  }
}

Configuration

Everything is configured via a single AdovvyChatbotConfig passed to AdovvySdk.init(...).

  • chainlitServer (String, required): server base URL used by the chatbot runtime.
  • chatbotId (String, required): chatbot identifier (mapped to JS as chatbotID).
  • buttonColor (String, required): CSS hex #RRGGBB.
  • loaderScriptUrl (String, required): URL to the loader script (<script src="...">).
  • scripts (List<String>, required): runtime script URLs passed to the loader config.

API

  • AdovvySdk.init({ required AdovvyChatbotConfig chatbotConfig })
    • Call once before any chat is opened.
  • AdovvySdk.openChat(BuildContext context)
    • Opens the full-screen chat route.
    • If init was not called, logs to the console (via debugPrint + FlutterError.reportError).
    • If loaderScriptUrl / scripts are missing/empty in AdovvyChatbotConfig, logs to the console.

Example app

See adovvy_sdk/example/ for a minimal Flutter app that initializes the SDK and opens chat.

Permissions (voice input / microphone)

If your chatbot UI uses voice input, you must add microphone permissions in your host app.

  • Android
    • Add this permission to android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
  • At runtime, the SDK will request microphone access when voice input is used.

  • iOS

    • Add this key to ios/Runner/Info.plist:
<key>NSMicrophoneUsageDescription</key>
<string>This app uses the microphone for voice input in chat.</string>

Permissions (attachments / camera & photos on iOS)

If your attachment UI can take a photo/video or access the photo library, iOS requires additional Info.plist usage descriptions (otherwise the app will crash when opening the camera picker).

Add these keys to ios/Runner/Info.plist:

<key>NSCameraUsageDescription</key>
<string>This app uses the camera to capture photos/videos for attachments.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app uses your photo library to select attachments.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app saves captured photos/videos to your photo library when needed.</string>

If you need support, please fill out this form: Support form.

Libraries

adovvy_sdk
Adovvy SDK library.