Unread badge
A reactive counter you hang on the icon your interface already has.
Nine native packages bring the widget inside your app — unread badge, chat, AI agent and release notes, with push on mobile — including stacks that are usually left out, such as Delphi 7 and Lazarus.
All nine native packages are published, each one on the package manager of its platform. Where there is no package, the web widget works in any app with a WebView.
Mobile
Desktop
Web and packaged
Delphi installs through Boss. Lazarus comes straight from the repository: clone it and open the bfocus_widget_lcl.lpk package. The others come from the registry of each platform.
The snippets below are the same ones in the README of each package.
<!-- before </body> --> <script> (function (w, d) { w.bFocusQueue = w.bFocusQueue || []; w.bFocus = w.bFocus || { init: function(o){ w.bFocusQueue.push(['init', o]); } }; var s = d.createElement('script'); s.async = true; s.src = 'https://widget.bfocus.com.br/v1/widget.js'; s.setAttribute('data-bf-key', 'bf_pk_…'); d.head.appendChild(s); })(window, document); bFocus.init({ user: { externalId: 'USR-123', name: 'João Silva' }, customer: { externalId: 'EMP-456', name: 'Empresa Ltda' }, userHash: '…' // signed on YOUR server }); </script>
Web widget — live, served from the CDN
# Flutter — pubspec.yaml bfocus_widget: ^0.1.0 // iOS — Package.swift (products BFocusWidget and BFocusWidgetCore) .package(url: "https://github.com/bernisoftware/bfocus-widget-ios", from: "0.1.2") // Android — build.gradle.kts (for Compose: bfocus-widget-android-compose) implementation("br.com.bernisoftware:bfocus-widget-android:0.1.0") # React Native $ npm i @bfocus/react-native-widget react-native-webview @react-native-async-storage/async-storage # .NET — or Bfocus.Widget.Wpf / Bfocus.Widget.Maui $ dotnet add package Bfocus.Widget.WinForms // Java desktop — or bfocus-widget-swing implementation("br.com.bernisoftware:bfocus-widget-javafx:0.1.0") # Delphi $ boss install github.com/bernisoftware/bfocus-widget-delphi # Lazarus — then open package/bfocus_widget_lcl.lpk $ git clone https://github.com/bernisoftware/bfocus-widget-lazarus # Python desktop — or [tk] $ pip install "bfocus-widget[qt]"
One command per platform. The publishable key is the same on all of them.
# pubspec.yaml dependencies: bfocus_widget: ^0.1.0 import 'package:bfocus_widget/bfocus_widget.dart'; await BFocus.init(BFocusConfig( publishableKey: 'bf_pk_…', user: BFocusUser(externalId: u.id, name: u.nome), customer: BFocusCustomer(externalId: u.empresaId), userHashProvider: () => minhaApi.bfocusUserHash(), navigatorKey: navigatorKey, product: 'erp', // optional: product tag ));
bfocus_widget package 0.1.0, published on pub.dev
// Flutter: the badge follows the widget state ValueListenableBuilder<String>( valueListenable: BFocus.badge, // '' | '•' | 'N' | '99+' builder: (context, label, _) => Badge( isLabelVisible: label.isNotEmpty, label: Text(label), child: IconButton( icon: const Icon(Icons.support_agent), onPressed: () => BFocus.open(context: context), ), ), );
The unread counter is reactive: you draw it wherever you want
The essentials work in all of them. Where the platform changes how, the text says which.
A reactive counter you hang on the icon your interface already has.
A version pill and a banner for the latest note, with a read confirmation whenever you require one.
On Flutter, iOS, Android, React Native and .NET MAUI, the notification goes out through your Firebase project, with your app's name and icon. On desktop, the badge and the system notification come from periodic checks.
Opens straight into the ticket or the release note; on mobile, also from a tap on the notification with the app closed.
Send a photo or a document and download what the agent replied with, using the right permissions on each system.
In the WebView packages, a screen of its own for when the network is down, with an automatic retry as soon as it comes back.
From the package manager of each platform: pub.dev, Swift Package Manager, Maven Central, npm, NuGet and PyPI. Delphi installs through Boss and Lazarus comes straight from GitHub. The source of all of them is at github.com/bernisoftware.
No. In the WebView packages, the interface comes from the CDN. In all of them, text, colors, knowledge base and agent come from the server, with no new app release.
There is browser mode: your system opens the widget in the default browser with the session already signed, and the user stays identified. That is how VB6, Harbour and Visual FoxPro work.
The public key identifies your account and can stay visible in the app. The HMAC signature, computed on your server, is what proves the user is who they say they are — with verified identity switched on, bFocus turns away anyone without it. It lasts 7 days: your server issues a new one when it expires.
You do. The native package’s origin is app:// followed by the app id, and it goes in the same authorized domain list as the widget. There the id is checked in full: app://com.customer does not allow app://com.customer.other, because the host is an app identifier, not a domain. Register one per app. On the web it is the other way round: the root domain already covers the subdomains.
Install the package for your stack or start with the web widget. The key is the same.