Skip to content

Browser SDK

A typed JavaScript client for AACsearch. Single search, federated multi-search, facets — under 50ms p99.

Search from the browser

NPM package. TypeScript types. Works in React, Vue, Svelte, Astro, or plain JS. No backend proxy required.

Full TypeScript types

Autocomplete on every method. No guessing response shapes. Types ship with the package — no @types/ needed.

Single search

search(indexSlug, query, options) → typed results. Facets, filters, sort, pagination — all in the options object.

Multi-search (federated)

multiSearch([...queries]) → typed results array. One HTTP request, parallel execution, independent facets.

Scoped token support

Initialise with a short-lived scoped token from your server. The SDK attaches it automatically to every request.

Typed error handling

Typed error objects with slug (search_failed, quota_exceeded, rate_limited). Catch and handle programmatically.

Under 5KB gzipped

Tree-shakeable ESM build. Only the methods you import are bundled. No runtime dependencies.

Get started in 3 steps

Add AACsearch to your website with a few lines of JavaScript.

  1. 1

    Step 1

    Install the package

    Install the AACsearch Browser SDK from npm. npm install @aacsearch/browser-sdk

  2. 2

    Step 2

    Initialize the client

    Create a client with your scoped token. import { AACSearchClient } from '@aacsearch/browser-sdk'; const client = new AACSearchClient({ token: 'ss_scoped_...' });

  3. 3

    Step 3

    Run a search

    Call search() from your frontend code. const results = await client.search({ q: 'shoes', limit: 10 }); console.log(results.hits);

Frequently asked questions

Launch Search OS in one evening

Create an index, add documents and connect search from your app. Free tier covers a prototype — data persists when you upgrade.