tsproxy
A production-ready search proxy for Typesense (opens in a new tab) with caching, rate limiting, an ingestion queue, and headless React components.
Why tsproxy?
Typesense is a fast, typo-tolerant search engine. But exposing it directly to frontend clients creates challenges:
- API key exposure — Typesense search-only keys still reveal your cluster details
- No caching layer — every keystroke hits your search cluster
- No rate limiting — bad actors can overwhelm your search backend
- No ingestion queue — bulk writes can spike resource usage
- InstantSearch compatibility — Typesense needs a translation layer for Algolia's InstantSearch widgets
tsproxy solves all of these with a single proxy server.
Architecture
Frontend (React) tsproxy API Typesense
┌─────────────────┐ ┌──────────────────┐ ┌──────────┐
│ @tsproxy/react │────▶│ HonoJS Proxy │───▶│ Typesense│
│ @tsproxy/js │ │ - LRU Cache │ │ Server │
│ InstantSearch │◀────│ - Rate Limiting │◀───│ │
└─────────────────┘ │ - BullMQ Queue │ └──────────┘
│ - Algolia ↔ TS │
│ Transform │
└──────────────────┘Packages
| Package | Description |
|---|---|
@tsproxy/api | HonoJS proxy server with search, ingest, caching, rate limiting |
@tsproxy/js | InstantSearch-compatible searchClient adapter for the proxy |
@tsproxy/react | Headless React components with BaseUI-style overrides |
Quick Start
# Clone and install
git clone https://github.com/akshitkrnagpal/tsproxy.git
cd tsproxy
pnpm install
# Start Typesense + Redis
docker compose up -d
# Seed sample data
pnpm seed
# Start the proxy and demo
pnpm devThen open http://localhost:3001/search (opens in a new tab).