Mobile SDKs

Native SDKs for embedding the widget in mobile apps, published as open source (MIT) on GitHub under github.com/Odditt-Betflow:

PlatformRepoInstallMinimum
Flutterodditt-flutter-sdkGit dependency (pub.dev planned)-
React Nativeodditt-react-native-sdknpm install @odditt/react-native-sdk react-native-webview-
iOSodditt-ios-sdkSwift Package Manager or CocoaPodsiOS 13+
Androidodditt-android-sdkJitPack (com.github.Odditt-Betflow:odditt-android-sdk)SDK 21+

Each SDK is a thin, typed wrapper around a platform WebView rendering your widget deployment - no custom native modules, no separate API integration. If your app is hybrid (Capacitor / Cordova / Ionic), you don't need an SDK at all: the standard iframe embed works unchanged inside your app's WebView.

Shared Concepts

All four SDKs expose the same surface, so integration knowledge transfers across platforms:

  • OddittWidget - the embed component (SwiftUI/Compose; OddittWidgetView for UIKit/Android Views).
  • baseUrl (required) - your widget deployment URL, provided by the Odditt team.
  • OddittWidgetConfig - typed configuration mirroring the iframe parameters in camelCase: country, colorMode (dark/light), layoutMode (carousel/feed), oddsFormat, widgetMode (operator/affiliate/clean), productMode (sportsbook/dfs/prediction_market), sportIds, plus an extraParams map for any other documented iframe parameter (preset, lang, leagueKey, includeAltLines, filter params, ...).
  • Typed event callbacks - the same events as the web widget's postMessage stream, delivered natively: a universal onSignal plus granular onBetClicked, onReady, onEmpty, onError, and onExternalUrl. Signal types: WIDGET_READY, WIDGET_EMPTY, WIDGET_ERROR, BET_CLICKED, PAGE_LOADED, FILTER_CHANGED, GRAPH_EXPANDED, GRAPH_COLLAPSED, CONTENT_HEIGHT_CHANGED, EXTERNAL_URL (+ an UNKNOWN case for forward compatibility).
  • Auto-height - the SDK injects a ResizeObserver and sizes the widget to its content (autoHeight, default on, with minHeight/maxHeight constraints) - no manual height management.
  • External link handling - window.open(), target="_blank", and custom-scheme navigations are intercepted and routed to the system browser / native apps, which is what makes affiliate click-outs and app deep links work from inside a WebView. Handle or observe them via onExternalUrl.
  • Device detection - device_type is seeded automatically from the platform (overridable via extraParams), so the right app vs. web deep links are chosen without configuration.

Quick Starts

Flutter

dependencies:
  odditt_flutter_sdk:
    git:
      url: https://github.com/Odditt-Betflow/odditt-flutter-sdk.git
      ref: main
OddittWidget(
  baseUrl: 'https://widget.example.com',
  config: const OddittWidgetConfig(
    country: 'US',
    colorMode: 'dark',
    layoutMode: 'carousel',
    widgetMode: 'operator',
    extraParams: {'preset': 'brand_dark_v2', 'lang': 'en-US'},
  ),
  onBetClicked: (bet) => openBetSlip(bet),
  onEmpty: () => hideWidgetSection(),
  onError: (e) => hideWidgetSection(),
);

React Native

npm install @odditt/react-native-sdk react-native-webview
# iOS: cd ios && pod install
<OddittWidget
  baseUrl="https://widget.example.com"
  config={{ country: 'US', colorMode: 'dark', layoutMode: 'carousel' }}
  onBetClicked={(bet) => openBetSlip(bet)}
  onEmpty={() => setShowWidget(false)}
  onError={() => setShowWidget(false)}
/>

iOS (SwiftUI)

// SPM: .package(url: "https://github.com/Odditt-Betflow/odditt-ios-sdk.git", branch: "main")
OddittWidget(
    baseUrl: "https://widget.example.com",
    config: OddittWidgetConfig(country: "US", oddsFormat: "american"),
    onBetClicked: { signal in openBetSlip(signal) }
)

UIKit apps use OddittWidgetView with the same configuration.

Android (Compose)

// settings.gradle.kts: maven(url = "https://jitpack.io")
// build.gradle.kts: implementation("com.github.Odditt-Betflow:odditt-android-sdk:main-SNAPSHOT")
OddittWidget(
    baseUrl = "https://widget.example.com",
    config = OddittWidgetConfig(country = "US"),
    onBetClicked = { bet -> openBetSlip(bet) }
)

Requires the INTERNET permission. View-based apps use OddittWidgetView.

Handling Empty & Error States

The same rule as the web embed applies - never leave a blank widget in your layout. Wire onEmpty and onError to collapse the widget's container (auto-height already shrinks the widget itself, but your section chrome - headings, padding - is yours to hide). See Integration Recipes for the full pattern and the scoping guidance that avoids empty feeds in the first place.

Next Steps


Did this page help you?