@cludosearch/cludo-api-client
v0.9.16
Published
Cludo API client library
Keywords
Readme
Getting Started with using this package in your project
Installation
npm install @cludosearch/cludo-api-client
Usage
Start by instantiating the Cludo client class. In the client options, you must pass engineId, apiKey, or both. For endpoints that require SiteKey authorization (search), engineId is required. For endpoints that require basic authorization, apiKey is required.
Instantiating the client
const searchClient = new CludoClient(
{
customerId: CUSTOMER_ID,
engineId: ENGINE_ID,
apiKey: API_KEY,
}
);Example: Make a search and display
const result = await searchClient.search.search({
query: '*'
});
console.log('RESULT TITLES', result.data.TypedDocuments.map(d => d.Fields['Title'].Value));Example: Index a document
await searchClient.content.indexDocument(CRAWLER_ID, {
Title: 'Hello Cludo',
Description: 'This is a description',
Url: 'https://www.example.com/path-to-page'
});