The Typesense Instantsearch adapter is a protocol bridge, not a search UI
A JS adapter library to build rich search interfaces with Typesense and InstantSearch.js
At a glance
- What is it?
- typesense-instantsearch-adapter lets you drive Algolia's Instantsearch widgets against a Typesense search server, so a team can keep the Instantsearch component library and replace the backend. It does not install Instantsearch for you, it only supports the widgets it has implemented, and if you already have a custom autocomplete you do not need it at all.
- Who is it for?
- This adapter suits a team already committed to the Instantsearch widget set that wants a self hosted search backend, and it does not suit a team whose search UI is a custom autocomplete, since the README states that typesense-js already supports client side fetching for that case.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 107 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 20, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Two projects on either side of one constructor
The problem is a mismatch of ecosystems. Instantsearch.js is Algolia's open source collection of ready made components for interactive search experiences, and it talks to a search client that the application supplies. Typesense is a separate search server with its own API and its own client library. If you want the Instantsearch component set but a self hosted backend, something has to translate one request and response shape into the other.
That something is this adapter. It exposes a constructor, `TypesenseInstantSearchAdapter`, and the instance it returns carries a `searchClient` property, which is exactly the shape Instantsearch expects to be handed. The React, Vue and Angular cousins of Instantsearch work with the same adapter, and the README notes that react-instantsearch also works with React Native.
The scope is worth stating plainly. This is a bridge for a search backend, not a search interface, not a ranking system and not an indexing pipeline. Typesense holds and queries the data, Instantsearch draws the widgets, and the adapter translates between them. A team evaluating it should be clear that swapping the backend does not change the visual language of the product at all, which is the point, and also the limit.
The adapter does not bring Instantsearch with it
Installation is one package, plus one dependency the adapter cannot avoid:
$ npm install --save typesense-instantsearch-adapter @babel/runtimeYarn users are given the equivalent command, and there is a third route for pages that cannot use a bundler, a script tag pointing at the published bundle on a CDN:
<script src="https://cdn.jsdelivr.net/npm/typesense-instantsearch-adapter@2/dist/typesense-instantsearch-adapter.min.js"></script>The comment in the README next to that tag is worth reading, because it flags a version pin as a sensible idea if you do not want to receive the latest minor version on every page load. Note also that the CDN path points at version 2 of the package while the current release line is 3, so a team copying that tag from the README is taking a different major version than the one described elsewhere in the same document.
The important part is what the package does not do. The README is explicit that, since this is an adapter, it will not install the Instantsearch library automatically. You have to add one of instantsearch.js, react-instantsearch, vue-instantsearch or angular-instantsearch to the application yourself, and the project also points at create-instantsearch-app as a way to start from a template.
The constructor is where the server and the query are configured
The configuration shape is what tells you how much of the Typesense API the adapter exposes. The `server` object holds the credentials and the cluster nodes, and `additionalSearchParameters` carries anything the search endpoint supports:
import TypesenseInstantSearchAdapter from "typesense-instantsearch-adapter";
const typesenseInstantsearchAdapter = new TypesenseInstantSearchAdapter({
server: {
apiKey: "abcd", // Be sure to use an API key that only allows search operations
nodes: [
{
host: "localhost",
path: "", // Optional. Example: If you have your typesense mounted in localhost:8108/typesense, path should be equal to '/typesense'
port: "8108",
protocol: "http",
},
],
cacheSearchResultsForSeconds: 2 * 60, // Cache search results from server. Defaults to 2 minutes. Set to 0 to disable caching.
},Two details in there matter for a production deployment. The API key comment is a warning that the key shipped to the browser should be restricted to search operations, since anything in the client bundle is readable by the user. And the `path` field is for Typesense mounted under a prefix, with the example given as mounting at localhost:8108/typesense and the path set to `/typesense`.
The `additionalSearchParameters` object is where the query semantics live, and the README says these parameters are passed directly to the Typesense search API endpoint, so any parameter the endpoint supports can go there. The one required field is `query_by`, which lists the fields to search, given in the example as `name,description,categories`.
Search results are cached for two minutes by default
The `cacheSearchResultsForSeconds` option deserves attention because it changes what a user sees. The documented default is two minutes, that is 120 seconds, and setting it to 0 disables caching.
Caching search responses in the client is a normal thing to do for a typeahead, since the same prefix is typed again and again while a user is still forming a query. The cost is staleness. If a product changes price, a record is added, or an index is re-imported, the search box can keep returning the old result set for up to the cache window, and the user sees a hit list that disagrees with the page they click through to.
The setting is per adapter instance rather than global, so a team can pick a short window for an autocomplete and a longer one for a results page, or disable it where freshness matters more than request volume. What the README does not discuss is what the cache is keyed on, whether it is shared between adapter instances in the same page, or how it behaves when the index changes, so if you enable it and see stale results, that behaviour is where to look first.
A second, quieter point: the adapter is a client side component talking to a Typesense node directly, which means the browser reaches the search server. Caching reduces the number of requests the server has to answer, and with a two minute default that reduction is significant for an interface built around keystroke by keystroke querying.
A custom autocomplete makes this adapter unnecessary
The README carries a note that is more useful than most of the install instructions, and it appears near the top of the page. If your search interface is built on a custom autocomplete component, or is based on Algolia's own `@algolia/autocomplete-js`, then you do not need this adapter to use it with Typesense, because the typesense-js library already supports client side fetching from any async data source. The README links to a specific comment on issue 88 for the longer explanation.
That is the real alternative, and the difference in approach is clear. The adapter exists to make a component library that speaks Algolia's protocol speak Typesense's protocol instead. If you are not using that component library, you are paying for a translation layer to solve a problem you do not have. typesense-js on its own can query a Typesense server directly, and a custom autocomplete can consume that.
So the decision is not really about Typesense. It is about whether you want the Instantsearch widget set. If the answer is yes, the adapter is the shortest path from Instantsearch to a self hosted backend. If the answer is no, and you are writing your own input and result list anyway, the adapter adds a dependency and a compatibility surface for nothing.
Widget support is the boundary, and the docs list it
Instantsearch has a long catalogue of widgets, and the adapter does not implement all of them. The README links to a widget compatibility section, and it says you can add any of the Instantsearch widgets that are supported by the adapter. That wording is doing real work, because a widget that is not implemented will not simply degrade, it will be missing.
This is the failure mode to plan for. A team that reads the Instantsearch documentation, selects a refinement list, a sort-by selector or a pagination widget, and only later discovers it is unsupported, has a broken page rather than a degraded one. The compatibility list is the document to read before designing the interface, not after.
For testing, the repository ships a working example under `test/support/testground`, and the README gives the exact command to run it, `npm run testground` from the project root. Having a runnable reference implementation in the repository is a real help when you are working out which widgets are usable, because you can see the expected behaviour rather than infer it.
The project also maintains a public demo, the songs search interface at songs-search.typesense.org, and a separate starter app repository, typesense-instantsearch-demo, which shows a minimal integration. Reading either of those alongside the compatibility list is the fastest way to establish whether the adapter covers the widgets you need.
A Babel and Webpack build with a Typesense 30.0 test server
The package metadata shows how the artefact is produced. The build is two steps, a Babel pass over `src` into `lib` and a Webpack pass into `dist`, and the shipped files are `dist/`, `lib/`, `src/`, `scripts/` and `index.d.ts`. The package is ESM, with `"type": "module"`, the entry point at `lib/TypesenseInstantsearchAdapter.js` and the type definitions at `index.d.ts`, and the type definitions are checked by `tsd` in a separate `test:type` script.
The test and lint story is visible in the same file:
"scripts": {
"pretest": "npm run lint && npm run test:type",
"postinstall": "node scripts/postinstall.cjs",
"prepublishOnly": "npm run build",
"lint": "eslint --fix . && prettier --write .",
"test": "jest --maxWorkers=1 --verbose",
"build:lib": "babel src -d lib --source-maps",And the local search server for development is a container, which is what makes the test suite possible at all:
"typesenseServer": "docker run -i -p 8108:8108 -v`pwd`/typesense-server-data/:/data typesense/typesense:30.0 --data-dir /data --api-key=xyz --listen-port 8108 --enable-cors",
"createServerNodesFile": "echo '172.17.0.2:8107:8108,172.17.0.3:7107:7108,172.17.0.4:9107:9108' > `pwd`/typesense-server-nodes",Note the Typesense version there, 30.0, and the CORS flag, both of which are what a browser based test needs. The project is MIT licensed, the last push to the repository was on 2026-07-08, and the recent releases are v3.0.3-2 on 2026-07-08, v3.0.3-1 and v3.0.2 on 2026-03-13. The presence of a pre-release style suffix on the newest tag suggests the 3.0 line is still settling.
Editorial conclusion
This adapter suits a team already committed to the Instantsearch widget set that wants a self hosted search backend, and it does not suit a team whose search UI is a custom autocomplete, since the README states that typesense-js already supports client side fetching for that case. Before you adopt it, open the widget compatibility section and confirm that every widget you plan to use is on the list, because a widget the adapter has not implemented will not behave the way the Instantsearch documentation suggests.
Frequently asked questions
What does the typesense-instantsearch-adapter do?
It is a JavaScript adapter that lets Algolia's Instantsearch.js widgets, and their React, Vue and Angular cousins, search data indexed in a Typesense server. The instance exposes a searchClient property, which is the object Instantsearch expects to be given.
How do I install the typesense-instantsearch-adapter?
The documented commands are `npm install --save typesense-instantsearch-adapter @babel/runtime` or the yarn equivalent, and there is a CDN script tag for pages without a bundler. Because it is an adapter, it does not install Instantsearch itself, so you also add instantsearch.js or one of the react, vue or angular variants.
Do I need the typesense-instantsearch-adapter for a custom autocomplete?
No. The README states that if your search interface is built on a custom autocomplete component or on `@algolia/autocomplete-js`, you do not need this adapter, because typesense-js already supports client side fetching from any async data source.
How long are search results cached in the typesense-instantsearch-adapter?
The `cacheSearchResultsForSeconds` option defaults to 2 minutes, and setting it to 0 disables caching. The README does not describe how the cache is keyed or how it interacts with index changes.
Which Instantsearch widgets does the typesense-instantsearch-adapter support?
Only the ones listed in its widget compatibility section of the README. A working example lives in `test/support/testground` and can be run with `npm run testground` from the project root, and a separate demo starter app is published as typesense-instantsearch-demo.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/typesense-typesense-instantsearch-adapter)Was this useful?