Skip to main content

Introduction

The @refine-ai/sdk package is the official TypeScript SDK for integrating Refine into your application. It provides:
  • Search — Text and image search with visual AI
  • Recommendations — Similar items, visitor, and user-based personalization
  • Product Listing Pages — Curated collections with pinned products
  • Event Tracking — Comprehensive analytics with automatic batching
  • Identity Management — Visitor, session, and user tracking
  • Plugins — Extensible architecture for consent, debugging, and auto-tracking

Quick Example

SDK Structure

The SDK is organized into namespaces:

Requirements

  • Runtime: Browser or Node.js 18+
  • TypeScript: 4.7+ (optional but recommended)
  • Bundle size: ~12KB gzipped

Documentation

Installation

Install and set up the SDK

Configuration

All configuration options

Text Search

Natural language search

Recommendations

AI-powered product recommendations

Event Tracking

Analytics and conversion tracking

Error Handling

Error types and handling patterns