Skip to main content

Looking for Flutter?

Use the AdMesh Flutter UI SDK for native recommendation rendering, tracking, and theming.

Quick Start

Get started with AdMesh in 3 simple steps:
1

Install the Package

2

Wrap Your App with AdMeshProvider

The provider initializes the SDK and manages your session context.
3

Choose Your Integration Format

Select the format that matches your use case:Tail & Product Format - Separate recommendations panel
Weave Ad Format - Embedded links in LLM responses

Core Concepts

Session Management

AdMesh uses sessions to track user interactions across multiple messages:
  • Session ID: Unique identifier for a user’s conversation session
  • Message ID: Unique identifier for each individual message/query
Your application is responsible for generating and managing session and message IDs. The SDK accepts these IDs but does not generate them.

Available Formats

AdMesh supports three recommendation formats:

Flutter SDK Guide

See the native Flutter integration guide for AdMeshSdk, AdMeshProvider, AdMeshRecommendations, tracking, and theming.

Core Components

AdMeshProvider

Context provider that initializes the SDK and manages session state. Required - wrap your entire app with this component.
Example:

AdMeshRecommendations

Displays recommendations in a separate panel. Use for Tail or Product format.
Example:

Tail & Product Format Guide

Complete integration guide for Tail & Product Format

WeaveAdFormatContainer

Wraps LLM response content and detects embedded AdMesh links. Use for Weave Ad Format.
Example:

Weave Ad Format Guide

Complete integration guide for Weave Ad Format with event-driven architecture

Streaming Event Utilities

For Weave Ad Format only - dispatch events to coordinate link detection with streaming responses.
Example:
These utilities are only needed for Weave Ad Format. See the Weave Ad Format guide for complete integration details.

Installation Methods


Requirements

React 16.8+

Requires React with Hooks support

API Key

Get your API key from the AdMesh dashboard

TypeScript

Full TypeScript support included

Modern Browser

Supports all modern browsers (Chrome, Firefox, Safari, Edge)

TypeScript Support

The SDK is written in TypeScript and includes full type definitions:
All components and utilities are fully typed for the best developer experience.

Troubleshooting

Check:
  • API key is valid and provided to AdMeshProvider
  • sessionId is provided to AdMeshProvider
  • Component is wrapped inside AdMeshProvider
  • Messages array is not empty (for AdMeshRecommendations)
  • Network requests are not blocked by CORS or ad blockers
Solution:
  • Ensure you’re using TypeScript 4.0 or higher
  • Import types explicitly: import type { Message } from 'admesh-ui-sdk'
  • Check that your tsconfig.json includes "moduleResolution": "node"
Note: Tracking is fully automatic. Do NOT:
  • Manually fire tracking pixels
  • Modify tracking URLs
  • Implement custom tracking logic
The SDK handles all tracking internally.

Styling & Customization

The AdMesh UI SDK includes a simple, framework-agnostic styling system that ensures your components look clean and consistent—no matter where they’re embedded (Next.js, React, Vite, or custom platforms).

Key Features

Style Isolation

Prevents CSS conflicts with host frameworks like Tailwind or Bootstrap.

Consistent Look

Same visual quality across all environments.

Custom Themes

Easily adjust colors, borders, and typography.

Light & Dark Modes

Built-in theme switching with simple configuration.

Default Styling

By default, the SDK injects its own scoped styles automatically. No CSS import is needed.

Custom Theming

You can customize the appearance by passing a theme to the AdMeshProvider:

Theme Options

CSS Variables

You can also override AdMesh styling with standard CSS variables:

Example Themes

Framework Integration

Next.js + Tailwind

AdMesh styles are isolated from Tailwind classes, so you can safely use both:

React + Bootstrap

Styling Best Practices

DO:
  • Use the theme prop on AdMeshProvider for global styling
  • Leverage CSS variables for fine-grained control
  • Test your theme in both light and dark modes
  • Keep styles consistent with your brand
DON’T:
  • Directly modify AdMesh component classes (they may change)
  • Override internal styles with !important (use theme API instead)
  • Mix multiple theming approaches (choose one method)

Next Steps

Choose your integration format and follow the detailed guide:

Tail & Product Format

Display recommendations in a separate panelBest for: Separate recommendations UI, simple integrationSetup time: 5-10 minutes

Weave Ad Format

Embed recommendations directly in LLM responsesBest for: Natural integration, conversational adsSetup time: 15-20 minutes