Looking for React?
Use the React frontend SDK guide for
admesh-ui-sdk, AdMeshProvider, AdMeshRecommendations, and WeaveAdFormatContainer.Quick Start
Get started with AdMesh in 3 simple steps:Create an SDK Instance
Core Concepts
Session Management
AdMesh uses sessions to tie recommendation exposures, clicks, and follow-up engagement to a single conversation.- Session ID: unique identifier for a conversation or recommendation thread
- Message ID: unique identifier for the specific user query or turn
Your Flutter app is responsible for storing and reusing
sessionId values between screens or app launches when needed.Supported Formats
The Flutter SDK currently supports these native rendering paths:| Format | Use Case | Widget |
|---|---|---|
| Tail | Summary-first recommendation panel | AdMeshRecommendations / AdMeshLayout |
| Product Card | Horizontal product carousel | AdMeshEcommerceCards |
| Bridge | Prompt-paste CTA and link-out flow | AdMeshBridgeFormat |
| Sponsored Follow-up | Suggested follow-up query with tracking | AdMeshFollowup |
Core APIs
AdMeshSdk
AdMeshSdk builds the /aip/context request payload, validates required identifiers, and returns parsed recommendation data.
AdMeshProvider and AdMeshScope
UseAdMeshProvider to inject the SDK, tracker, session state, optional theme, and conversation metadata into the widget tree.
Recommendation Widgets
AdMeshRecommendations
AdMeshRecommendations is the main high-level widget. It accepts either pre-fetched recommendation data or an async loader that calls the SDK.
AdMeshLayout
AdMeshLayout selects the correct native widget based on backend format metadata:
product_cardwithproducts[]rendersAdMeshEcommerceCardsbridgeorbridge_promptrendersAdMeshBridgeFormat- everything else falls back to the tail-style recommendation layout
Format-specific Widgets
Use these directly when you want tighter control over your UI composition:AdMeshFollowup only renders when the recommendation includes:
followup_queryfollowup_engagement_urlfollowup_exposure_url
Tracking
The Flutter SDK includes the same core tracking primitives as the React SDK, adapted to native widget composition.AdMeshTracker
AdMeshTracker handles:
- exposure deduplication by
sessionId + recommendationId - click tracking
- follow-up exposure tracking
- follow-up engagement tracking
AdMeshViewabilityTracker
Wrap recommendation widgets withAdMeshViewabilityTracker to fire impressions after the recommendation is at least 50% visible for 1 second.
AdMeshLinkTracker
UseAdMeshLinkTracker around tap targets that should fire tracked click URLs before opening a destination.
Theming
UseAdMeshThemeData as a ThemeExtension to style recommendation surfaces consistently across your app.
Requirements
- Flutter
3.19.0+ - Dart
3.3.0+ - A valid AdMesh API key
- Your app must provide and manage
sessionIdandmessageId
httpprovidervisibility_detector
Troubleshooting
The SDK throws an error about sessionId or messageId
The SDK throws an error about sessionId or messageId
AdMeshSdk requires both values for every recommendation request. Generate them with AdMeshSdk.createSession() and AdMeshSdk.createMessageId(sessionId) and store the session ID in your app state.Nothing renders in AdMeshRecommendations
Nothing renders in AdMeshRecommendations
Check that your loader returns a real recommendation object and that the backend response includes a supported format.
AdMeshRecommendations shows nothing when there is no recommendation data.Bridge or follow-up UI is not showing
Bridge or follow-up UI is not showing
Bridge UI needs
preferred_format: bridge or bridge_prompt / bridge_content. Sponsored follow-ups only render when followup_query, followup_engagement_url, and followup_exposure_url are all present.Weave behavior does not match the web SDK
Weave behavior does not match the web SDK
Flutter v1 does not support DOM-based Weave link detection or mutation. Render structured recommendation payloads with
AdMeshLayout or AdMeshRecommendations instead.