Overview
@empathyco/x-adapter-platform is a pre-built adapter that provides a complete client for the Empathy Platform search API. It implements the adapter pattern from @empathyco/x-adapter with all the endpoint configurations needed to connect Interface X to Empathy’s search services.
Installation
Basic Usage
Configuration
Environment to connect to. Options:
'staging', 'live'Your Empathy Platform instance identifier
Language code for search results (e.g., ‘en’, ‘es’, ‘fr’)
Whether user has given consent for tracking
Optional document ID for tracking
Optional UI language (defaults to
lang value)Supported Endpoints
The platform adapter provides pre-configured endpoints for:- Search - Main search query endpoint
- Query Suggestions - Autocomplete suggestions
- Popular Searches - Trending search queries
- Recommendations - Product recommendations
- Next Queries - Related search suggestions
- Related Tags - Tag-based refinements
- Identifier Results - SKU/model number search
- Semantic Queries - AI-powered alternative queries
- Experience Controls - Feature flags and configuration
- Tagging - Analytics event tracking
Advanced Configuration
Custom Base URL
Response Interceptors
TypeScript Support
The adapter is fully typed and exports interfaces for all request and response types:Dependencies
@empathyco/x-adapter- Base adapter utilities@empathyco/x-types- TypeScript type definitions@empathyco/x-utils- Shared utilities
Related Resources
x-adapter
Base adapter pattern and utilities
Platform Integration
Integration guide for Empathy Platform
Custom API
Creating custom API adapters
x-components
Main component library
