Configuration

Khoji is configured entirely through data-* attributes on the script tag. There is no dashboard to log into and no JSON config to host.

AttributeDefaultWhat it does
data-khojiMarks the tag so Khoji can find its own config. Required.
data-sitemap/sitemap.xmlPath or URL of your sitemap. Sitemap-index files are followed automatically.
data-accent#e11d48Accent color for the button, highlights and links. Any CSS color.
data-placeholderSearch this site…Placeholder text of the search input. Use your language.
data-max-pagestier limitCap indexed pages below your tier limit (200 free / 2,000 paid).
data-no-buttonfalseSet "true" to hide the floating button and trigger search yourself via window.Khoji.open().
data-keyYour license key on paid plans. Removes the badge and raises the page cap.
data-modelMiniLM-L6-v2Advanced: swap the embedding model for any transformers.js-compatible feature-extraction model.

JavaScript API

The widget exposes a small global for programmatic control:

window.Khoji.open()          // open the search palette
window.Khoji.close()         // close it
await window.Khoji.search(q) // run a query, get results as data
window.Khoji.reindex()       // clear the cached index and rebuild

Wiring your own trigger

Hide the floating button and connect Khoji to your existing search icon:

<script src="https://khoji.aiskillhub.info/widget/khoji.js"
  data-khoji data-no-button="true" async></script>
<script>
  document.querySelector("#my-search-icon")
    .addEventListener("click", () => window.Khoji.open());
</script>

Styling

The widget renders inside a Shadow DOM, so your site's CSS never conflicts with it and vice versa. The palette follows the visitor's light/dark preference automatically; data-accent controls the brand color in both modes.