---
title: "Authenticate without domain set up"
slug: "authenticate-without-domain-set-up"
abstract: "How to authenticate without domain setup using Sitecore Discover 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 Discover. The values for credentials can be found in Discover Customer Engagement Console (CEC).

> [!note]
> Credentials depend on how your domain is set up with Sitecore. Authentication fails when there are incorrect credentials.

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, as shown in the following code block.

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

    const Root = () => {
        return (
            <WidgetsProvider
                    env='<environment>'
                    customerKey='<customer key>'
                    apiKey='<API key provided in CEC>'
                    useToken=true
                >
                <MyApp />
            </WidgetsProvider>
    )};
    ```

> [!note]
> 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.