---
title: "Authenticate without domain set up"
slug: "authenticate-without-domain-set-up"
abstract: "How to authenticate without domain setup using Sitecore Search JS SDK and UI components."
---
# Authenticate without domain set up

The exact use of the `WidgetsProvider` component depends on whether your domain is set up with Sitecore Search. The values for credentials can be found on the **Developer resources** **API Access** tab of the Sitecore Search interface.

> [!note]
> Credentials depend on how your domain is set up with Sitecore. Authentication fails when there are [incorrect credentials](https://doc.sitecore.com/search/en/developers/search-js-sdk-for-react/working-with-js-sdk-and-ui-components/credentials-for-authentication.html "Credentials for authentication").

> [!important]
> The JS SDK sets a cookie and includes the UUID when tracking events. Visitor information, UUID, is required to personalize search results.

To authenticate when your subdomain is not set up:

- In the `Root` component of your React project, add the `WidgetsProvider` component with correct [credentials for authentication](https://doc.sitecore.com/search/en/developers/search-js-sdk-for-react/js-sdk-reference/credentials-for-authentication.html "Credentials for authentication"), as shown in the following code block.

    ```js
    import { WidgetsProvider } from "@sitecore-search/react";

    const Root = () => {
        return (
            <WidgetsProvider
                    env='<environment>'
                    customerKey='<customer key>'
                    apiKey='<Either the API key provided in Search, or a Bearer token obtained using the API key >'
                >
                <MyApp />
            </WidgetsProvider>
    )};
    ```

> [!note]
> For the `env` attribute, the value must be one of `apse2` (for Asia/Oceania domains), `prodEu` (for European domains), or `prod` (for US domains).

> [!important]
> Authenticating using this method exposes the access token on your page. This is a security risk to your page and domain. We strongly recommend that you authenticate with subdomain setup.