Skip to content

SearchcraftConfig

The SearchcraftConfig object is used to initialize the Searchcraft JavaScript SDK in your front-end application. See the getting started page for a guide on how and where to use this configuration object.

readKey: string

The read key value to use when sending Searchcraft search requests. This value needs read key-specific permissions. If you are using Searchcraft Cloud, this value can be configured in Vektron.


endpointURL: string

The endpoint url of your Searchcraft cluster where your specified search index exists. If you are using Searchcraft Cloud, this value can be found within the Vektron dashboard in the Code Snippets section when configuring a search index.


indexName: string

Name of the Searchcraft search index to search for results within. If you are using Searchcraft Cloud, this value can be found within the Vektron dashboard in the Code Snippets section when configuring a search index.


optional cortexURL: string

The URL pointing towards Searchcraft Cloud’s semantic search and RAG summary processing layer. When using a searchcraft-summary-box component, this value must be specified.

optional summaryInstructionsPrompt: string

A prompt which provides additional instructions to the LLM when creating RAG search result summaries.

optional summaryDebounceDelay: number

The amount of delay, in milliseconds, to debounce summary requests. Defaults to 1000

optional initialQuery: string

The initial search query to call when Searchcraft is first initialized in your front-end application. This parameter can be used when you want to populate a page with an initial set of search results based on a query.

This value is a stringified Search query object. For a more in-depth reference on search queries, see the search endpoint documentation.


optional searchDebounceDelay: number

The amount of delay, in milliseconds, to debounce search requests. Defaults to 0.


optional searchResultsPerPage: number

The maximum number of results to return per page.


optional userId: string

A unique user identifier that represents a unique end-user of your product. This is an optional value that can be passed in for analytics and data visualization purposes within Searchcraft Cloud’s Vektron Dashboard.

optional customAdConfig: object

This object allows you to configure the quantity, number, template, and positioning of custom ad containers within your search results. To see more information on how to configure custom ads, see the custom ads guide

PropertyTypeDescription
templateCustomAdTemplateThe template to use when rendering custom ad containers.
adStartQuantitynumber optionalThe number of custom ads to render at the start of the search results page.
adEndQuantitynumber optionalThe number of custom ads to render at the end of the search results page.
adInterstitialIntervalnumber optionalRenders a custom ad in between search results, at the specified interval.
adInterstitialQuantitynumber optionalSpecifies the number of ads to be rendered in each interstitial in between search results.
adContainerRenderedDebounceDelaynumber optionalThe amount of debounce delay to add before calling the ad_container_rendered event. The use case for setting this value would be when you would like to limit the number of ad calls being made when users are quickly paging through search results.