Universal JavaScript search library for instant, AI-powered search across any website or app. Built for speed. Designed for developers. Free forever.
Powered by SearchJet Engine — the fastest way to add intelligent search to your website.
<script src="https://cdn.jsdelivr.net/gh/maidulcu/searchjet-connect@latest/dist/searchjet-connect.min.js"></script>
<div id="searchjet-container"></div>
<script>
SearchJet.initAuto({ apiKey: 'your-key' });
</script>npm install @searchjet/connectimport SearchJet from '@searchjet/connect';
const sj = new SearchJet({ apiKey: 'your-key' });
sj.init('#search-container');- Instant Results — Sub-50ms search powered by SearchJet Engine
- Typo Tolerant — AI-powered fuzzy matching handles misspellings
- Zero Config — Drop in a script tag and one line of JS
- Framework Agnostic — Works with React, Vue, Angular, Svelte, or vanilla JS
- Customizable — Full control over templates, styling, and behavior
- Lightweight — <10KB gzipped, no dependencies
Auto-generated search UI with a single line:
const sj = new SearchJet({ apiKey: 'your-key' });
sj.init('#search-container');Full control with composable widgets:
const sj = new SearchJet({ apiKey: 'your-key' });
const search = sj.instantSearch();
search.addWidget(
SearchJet.widgets.searchBox({
container: '#searchbox',
placeholder: 'Search products...',
debounce: 300
})
);
search.addWidget(
SearchJet.widgets.hits({
container: '#hits',
templates: {
item: (hit) => `
<div class="product">
<img src="${hit.thumbnail}" alt="${hit.title}" />
<h3>${hit.title}</h3>
<p>${hit.excerpt}</p>
<span class="price">${hit.currency}${hit.price}</span>
</div>
`
}
})
);
search.addWidget(
SearchJet.widgets.pagination({
container: '#pagination'
})
);
search.start();// Auto-initialize (finds #searchjet-container automatically)
SearchJet.initAuto({ apiKey: 'your-key' });
// Create instance manually
const sj = SearchJet.init({ apiKey: 'your-key' });
sj.init('#my-search');
// Shopify integration
const sj = SearchJet.forShopify({ apiKey: 'your-key' });| Option | Type | Default | Description |
|---|---|---|---|
container |
string | HTMLElement | required | CSS selector or DOM element |
placeholder |
string | 'Search...' |
Input placeholder text |
autofocus |
boolean | false |
Auto-focus on page load |
searchAsYouType |
boolean | true |
Search on each keystroke |
showReset |
boolean | true |
Show clear button |
showSubmit |
boolean | false |
Show submit button |
debounce |
number | 300 |
Debounce delay in ms |
| Option | Type | Default | Description |
|---|---|---|---|
container |
string | HTMLElement | required | CSS selector or DOM element |
templates.item |
function | — | Custom hit template |
templates.empty |
function | — | Empty state template |
transformItems |
function | items => items |
Transform results before render |
| Option | Type | Default | Description |
|---|---|---|---|
container |
string | HTMLElement | required | CSS selector or DOM element |
maxPages |
number | 10 |
Max visible page buttons |
showFirst |
boolean | true |
Show first page button |
showLast |
boolean | true |
Show last page button |
showPrevious |
boolean | true |
Show previous button |
showNext |
boolean | true |
Show next button |
| Option | Type | Default | Description |
|---|---|---|---|
apiKey |
string | required | Your SearchJet API key |
baseUrl |
string | 'https://app.searchjetengine.com/api' |
API endpoint |
maxCacheSize |
number | 100 |
Max cached search results |
init(container)— Mount auto-generated search UI to a containerinstantSearch(config)— Create an InstantSearch instance for custom widget layouts
SearchJet.init(config)— Create and return a new SearchJet instanceSearchJet.initAuto(config)— Auto-find#searchjet-containerand initializeSearchJet.forShopify(config)— Create a Shopify-optimized instance
Full TypeScript definitions included. Works out of the box with VS Code, WebStorm, and other editors.
import SearchJet, { SearchJetConfig, InstantSearch, Widget } from '@searchjet/connect';- Chrome 60+
- Firefox 55+
- Safari 11+
- Edge 79+
git clone https://github.com/maidulcu/searchjet-connect.git
cd searchjet-connect
npm install
npm run build # Build all formats (ESM, UMD, minified)
npm run dev # Watch mode
npm test # Run tests
npm run lint # Lint source files- Fork the repository
- Create your feature branch (
git checkout -b feat/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feat/amazing-feature) - Open a Pull Request