fumadocs-core
Version:
The React.js library for building a documentation website
24 lines (23 loc) • 662 B
JavaScript
import { createMixedbreadSearchAPI } from "../mixedbread.js";
// src/search/client/mixedbread.ts
/**
* @deprecated Use `createMixedbreadSearchAPI` from `fumadocs-core/search/mixedbread` instead.
* This client-side approach exposes your API key in the browser.
* The server-side approach keeps the key secure and uses `useFetchSearch()` on the client.
*/
function mixedbreadClient(options) {
const { client, storeIdentifier, tag } = options;
const api = createMixedbreadSearchAPI({
client,
storeIdentifier
});
return {
deps: [
client,
storeIdentifier,
tag
],
search: (query) => api.search(query, { tag })
};
}
export { mixedbreadClient };