--- title: Endpoints slug: '331' canonical_url: https://docs.coveo.com/en/331/ collection: javascript-search-framework source_format: adoc --- # Endpoints A _search endpoint_ is an object whose interface allows the [Coveo JavaScript Search Framework](https://docs.coveo.com/en/187/) to perform HTTP requests against the Search API (for example, [queries](https://docs.coveo.com/en/231/)). One of the first steps required to set up a functional [search interface](https://docs.coveo.com/en/2741/) is to configure a search endpoint. ## Configuring a new search endpoint Use the [`configureCloudV2Endpoint`](https://coveo.github.io/search-ui/classes/searchendpoint.html#configurecloudv2endpoint) method of the [`SearchEndpoint`](https://coveo.github.io/search-ui/classes/searchendpoint.html) class to configure a new endpoint. **Examples** * Initializing an endpoint which relies on [API key authentication](https://docs.coveo.com/en/105/). ```javascript Coveo.SearchEndpoint.configureCloudV2Endpoint( "mycoveocloudv2organizationg8tp8wu3", "MY_API_KEY" ); // ... Coveo.init(document.getElementById("search")); ``` * Initializing a more complex endpoint which targets a HIPAA [organization](https://docs.coveo.com/en/185/) and relies on [search token authentication](https://docs.coveo.com/en/56/). ```javascript // This function must return a promise const renewToken = () => { // Implementation ... }; Coveo.SearchEndpoint.configureCloudV2Endpoint( "mycoveocloudv2organizationg8tp8wu3", "MY_SEARCH_TOKEN", "https://platformhipaa.cloud.coveo.com/rest/search", { renewAccessToken: renewToken } ); // ... Coveo.init(document.getElementById("search")); ``` ## Configuring a demo search endpoint The `SearchEndpoint` class exposes a [`configureSampleEndpointV2`](https://coveo.github.io/search-ui/classes/searchendpoint.html#configuresampleendpointv2) method which lets you configure an endpoint that targets a demo organization whose [index](https://docs.coveo.com/en/204/) contains various sample [items](https://docs.coveo.com/en/210/). This can be useful when you're testing the framework. **Example** Configuring a demo search endpoint. ```javascript Coveo.SearchEndpoint.configureSampleEndpointV2(); // ... Coveo.init(document.getElementById("search")); ```