Skip to main content

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:
1

Add the Package

2

Create an SDK Instance

Your application owns session and message lifecycle. The SDK validates these values but does not persist them for you.
3

Choose Your Integration Pattern

Direct fetch
Provider + widget integration

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:
Flutter v1 does not implement DOM mutation, CSS injection, or browser-specific Weave link scanning. If your backend returns structured recommendation data, render it with the Flutter widgets instead of expecting web-style inline link processing.

Core APIs

AdMeshSdk

AdMeshSdk builds the /aip/context request payload, validates required identifiers, and returns parsed recommendation data.
Public types

AdMeshProvider and AdMeshScope

Use AdMeshProvider to inject the SDK, tracker, session state, optional theme, and conversation metadata into the widget tree.
Access the active controller from descendant widgets:

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_card with products[] renders AdMeshEcommerceCards
  • bridge or bridge_prompt renders AdMeshBridgeFormat
  • 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_query
  • followup_engagement_url
  • followup_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 with AdMeshViewabilityTracker to fire impressions after the recommendation is at least 50% visible for 1 second.

AdMeshLinkTracker

Use AdMeshLinkTracker around tap targets that should fire tracked click URLs before opening a destination.

Theming

Use AdMeshThemeData as a ThemeExtension to style recommendation surfaces consistently across your app.
Customize colors, typography, spacing, and border radius:
The main theme type exposed by the package is:

Requirements

  • Flutter 3.19.0+
  • Dart 3.3.0+
  • A valid AdMesh API key
  • Your app must provide and manage sessionId and messageId
Package dependencies used by the SDK:
  • http
  • provider
  • visibility_detector

Troubleshooting

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.
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 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.
Flutter v1 does not support DOM-based Weave link detection or mutation. Render structured recommendation payloads with AdMeshLayout or AdMeshRecommendations instead.

React Frontend SDK

Use the React SDK for web-based recommendation rendering and browser-specific Weave flows.

Platforms Overview

Compare integration approaches and format options across AdMesh platform surfaces.