Getting Started
What is AdMesh?
What is AdMesh?
- React SDK (
admesh-ui-sdk): For frontend integration with citation format and product card layouts - AdMesh Weave Node SDK (
admesh-weave-node): For backend Node.js integration with weave format
How do I choose between weave format and citation format?
How do I choose between weave format and citation format?
| Aspect | Weave Format | Citation Format |
|---|---|---|
| What it is | Inline product cards embedded in conversation | Clickable links within conversational text |
| Best for | Visual-heavy platforms, mobile apps | Text-based platforms, chat interfaces |
| Integration | AdMesh Weave Node SDK (backend) | React SDK (frontend) |
| User Experience | Rich, interactive cards | Minimal, non-intrusive links |
| Implementation | Backend Node.js integration | Frontend React integration |
| Performance | Requires more bandwidth | Lightweight |
- Your platform supports rich media/cards
- You want a visual, interactive experience
- You have sufficient bandwidth
- Your platform is text-based
- You want minimal UI changes
- You want lightweight integration
When should I use the React SDK vs. AdMesh Weave Node SDK?
When should I use the React SDK vs. AdMesh Weave Node SDK?
| Aspect | React SDK | AdMesh Weave Node SDK |
|---|---|---|
| Supported Formats | Citation, Product Cards | Weave Format |
| Best for | Frontend React applications | Backend Node.js applications |
| Setup Time | 5-10 minutes | 15-30 minutes |
| Customization | Limited (UI components) | Full control (backend logic) |
| Maintenance | Automatic updates | Manual updates |
| Language | JavaScript/TypeScript (React) | Node.js (JavaScript/TypeScript) |
| Deployment | Frontend (browser) | Backend (server) |
- Your platform is built with React
- You want citation or product card format
- You want quick frontend integration
- You need UI components for recommendations
- You need weave format (inline product cards)
- Your backend is built with Node.js
- You want to embed recommendations in LLM responses
- You need backend-side recommendation logic
React SDK Integration
How do I install the React SDK?
How do I install the React SDK?
What formats does the React SDK support?
What formats does the React SDK support?
- Citation Format - Clickable links within conversational text
- Product Card Layouts - Individual product recommendation cards
How do I use the React SDK in my application?
How do I use the React SDK in my application?
- Wrap your app with
<AdMeshProvider>and passsessionId - Use
<AdMeshRecommendations>to display recommendations - The SDK handles message deduplication and recommendation fetching automatically
What is the sessionId parameter?
What is the sessionId parameter?
sessionId parameter identifies a unique user session in AdMesh:- Purpose: Track recommendations across a conversation
- Format: Any string (e.g.,
'user-session-123') - Scope: Should be unique per user session
- Lifetime: Persists for the duration of the conversation
Example:
Best Practices:
- Generate a new
sessionIdfor each user session - Store it in state or context
- Pass the same
sessionIdthroughout the conversation - Don’t change
sessionIdmid-conversation
chatId= Perplexica’s internal chat identifiersessionId= AdMesh session identifier (passed to AdMeshProvider)
How do I customize the React SDK styling?
How do I customize the React SDK styling?
Does the React SDK work with my CSS framework?
Does the React SDK work with my CSS framework?
- Tailwind CSS
- Bootstrap
- Material-UI
- Chakra UI
- Styled Components
- Emotion
Weave Format Integration
How do I integrate weave format?
How do I integrate weave format?
- Install SDK:
npm install admesh-weave-node - Initialize SDK: Set up with your API key
- Call Recommendation API: Get recommendations for user query
- Embed in LLM Response: Integrate recommendations into your LLM response
- Track Interactions: Fire exposure, click, and conversion pixels
What's the weave format API flow?
What's the weave format API flow?
How do I render weave format cards?
How do I render weave format cards?
- Call AdMesh Weave Node SDK to get recommendations
- Format recommendations as product cards
- Embed cards in LLM response text
- Return complete response to frontend
- Display the LLM response with embedded cards
- Fire exposure pixel when card is shown
- Fire click pixel when user clicks
- Handle card interactions
How do I track weave format interactions?
How do I track weave format interactions?
- Exposure tracking when recommendations are generated
- Click tracking via signed URLs
- Conversion tracking via tracking pixels
Citation Format Integration
How do I integrate citation format?
How do I integrate citation format?
- React SDK (recommended for React apps)
- Direct API (for any platform)
What does citation format look like?
What does citation format look like?
How do I customize citation format styling?
How do I customize citation format styling?
API Integration
How do I get an API key?
How do I get an API key?
- Log in to your AdMesh Dashboard
- Go to Settings → API Keys
- Click Generate New Key
- Copy your API key (format:
admesh_prod_xxx) - Store securely (never commit to version control)
How do I authenticate API requests?
How do I authenticate API requests?
What's the /recommend endpoint?
What's the /recommend endpoint?
/recommend endpoint returns recommendations for a user query:What are tracking URLs?
What are tracking URLs?
- exposure_pixel: Fire when recommendation is shown
- click_url: Redirect when user clicks
- HMAC-SHA256 signature
- TTL (time-to-live, default 300 seconds)
- Nonce for idempotency
Performance & Optimization
What are the performance requirements?
What are the performance requirements?
- API Response Time: < 500ms
- Recommendation Latency: < 1 second
- Pixel Firing: < 100ms
- SDK Bundle Size: ~25KB gzipped
- API Response Time: < 200ms
- Recommendation Latency: < 500ms
- Pixel Firing: < 50ms
How can I optimize performance?
How can I optimize performance?
- Cache Recommendations: Cache results for 5-10 minutes
- Lazy Load SDK: Load SDK only when needed
- Batch Requests: Combine multiple requests when possible
- Use CDN: Serve SDK from CDN for faster delivery
- Monitor Latency: Track API response times
What's the rate limit?
What's the rate limit?
- Free Tier: 100 requests/minute
- Pro Tier: 1,000 requests/minute
- Enterprise: Custom limits
How do I handle rate limiting?
How do I handle rate limiting?
Contextual Relevance
What is contextual relevance scoring?
What is contextual relevance scoring?
- 90-100: Highly relevant
- 70-89: Relevant
- 50-69: Somewhat relevant
- < 50: Not relevant
How is relevance calculated?
How is relevance calculated?
- Semantic Matching: Compare query embeddings with product embeddings
- Keyword Matching: Match query keywords with product keywords
- Category Matching: Match query intent with product categories
- User History: Consider user’s past interactions
How can I improve relevance scores?
How can I improve relevance scores?
- Better Product Data: Provide detailed titles, descriptions, keywords
- Accurate Categories: Assign correct product categories
- Rich Metadata: Include price, brand, ratings, etc.
- Update Regularly: Keep product data current
Testing & Debugging
How do I test my integration?
How do I test my integration?
- Test API Key: Verify API key is valid
- Test Endpoint: Call
/recommendwith test query - Test Rendering: Verify recommendations display correctly
- Test Tracking: Verify pixels fire correctly
- Test Edge Cases: Test with no results, errors, etc.
How do I debug integration issues?
How do I debug integration issues?
- Check Console: Look for JavaScript errors
- Check Network: Verify API requests are successful
- Check Pixels: Verify tracking pixels are firing
- Check Logs: Review server logs for errors
- Enable Debug Mode: Add
debug=trueto API requests
What should I test before going live?
What should I test before going live?
- API key is valid and secure
- Recommendations display correctly
- Tracking pixels fire correctly
- Error handling works
- Performance meets requirements
- Mobile responsiveness works
- Accessibility is compliant
- Security is verified
How do I report bugs?
How do I report bugs?
- Email: [email protected]
- Dashboard: Click Help → Report Bug
- GitHub: Open issue in AdMesh repository
- Description of the issue
- Steps to reproduce
- Expected vs. actual behavior
- Screenshots/logs if applicable
Common Issues
My API requests are failing
My API requests are failing
- API Key: Verify key is correct and not expired
- Authorization Header: Ensure header format is correct
- Endpoint URL: Verify you’re using correct endpoint
- Request Body: Validate JSON is properly formatted
- Network: Check internet connection
Recommendations aren't showing up
Recommendations aren't showing up
- API Response: Verify API returns recommendations
- Rendering: Check if recommendations are being rendered
- Styling: Verify CSS isn’t hiding recommendations
- JavaScript: Check for JavaScript errors in console
- Permissions: Verify API key has correct permissions
Tracking pixels aren't firing
Tracking pixels aren't firing
- Pixel URL: Verify pixel URL is correct
- Network: Check if pixel request is being sent
- Ad Blockers: Disable ad blockers and test
- CORS: Verify CORS headers are correct
- Timing: Ensure pixel fires at correct time
Performance is slow
Performance is slow
- Cache Results: Cache recommendations for 5-10 minutes
- Lazy Load: Load SDK only when needed
- Compress: Enable gzip compression
- CDN: Use CDN for static assets
- Monitor: Track API response times