One CDN script tag. Zero build step. Zero backend. If you can write an <input>, you can ship search.
This is the exact behaviour your static site gets from the script tag below.
Drop the CDN script into any page. No npm, no bundler, no framework. Works on GitHub Pages, Netlify, WordPress, or a plain HTML file.
Call through a tiny proxy route (or serverless function) and your API key never leaves the server. Same endpoint as the SDK.
Sub-second, typo-tolerant results served from the CDN edge. Static sites get the same search UX as app stores.
Save as search.html and open it. That's it.
<!DOCTYPE html>
<html lang="en">
<head>
<!-- 1. One CDN tag — that's the whole install -->
<script src="https://cdn.searchjet.io/connect/v1/searchjet.min.js"></script>
</head>
<body>
<input id="q" placeholder="Search this site…" />
<ul id="results"></ul>
<script>
// 2. Initialize the client
const searchjet = new SearchJet({
apiKey: 'your_search_api_key',
indexName: 'my_site'
});
// 3. Debounce (no library needed)
let timer;
const box = document.getElementById('q');
box.addEventListener('input', (e) => {
clearTimeout(timer);
timer = setTimeout(async () => {
const { results } = await searchjet.search(e.target.value);
// 4. Render results — plain DOM, zero dependencies
document.getElementById('results').innerHTML =
results.map(h => `<li><a href="${h.url}">${h.title}</a></li>`).join('');
}, 200);
});
</script>
</body>
</html>// // PROTECT YOUR KEY — tiny proxy (Vercel / Netlify function)
// // Browser only ever calls YOUR domain. Add CORS headers here.
export default async function handler(req, res) {
const q = req.query.q;
if (!q) return res.status(400).json({ error: 'q required' });
const data = await fetch(
`https://app.searchjetengine.com/api/v1/search?q=${encodeURIComponent(q)}&limit=8`,
{
headers: {
// Server-side key — never shipped to the browser
Authorization: `Bearer ${process.env.SEARCHJET_API_KEY}`,
},
}
).then((r) => r.json());
res.setHeader('Access-Control-Allow-Origin', '*');
res.json(data.results);
}The SearchJet API answers browser calls directly (public search keys), but proxying keeps your key out of the bundle and gives you audit logs.
Free forever plan — 10,000 searches/month, no credit card.