Install the NextJS starter kit

Now that you have reviewed the prerequisites, you can install the starter kit, create the environment file to connect to your Content Hub ONE tenant and serialize items, and log in to your Content Hub ONE instance.

Before you begin

To install the Next JS starter kit:

  1. Open an administrative command line, navigate to the root of the repository folder and run the command npm install.

  2. Also in the repository folder, make a copy of the .env.example file, and name it .env.

  3. In the .env file, enter the following parameters. You can find the appropriate values for each parameter in the corresponding location shown in the table. Where available, you can use the Copy copy icon button to add the value to your clipboard.

    Parameter

    Location

    SITECORE_CLIENT_ID

    In the Content Hub ONE app, on the menu bar, click Settings and, in the INTEGRATION section of the left pane, click OAuth client, and then select the Client Credentials option.

    SITECORE_CLIENT_SECRET

    In the Content Hub ONE app, on the menu bar, click Settings and, in the INTEGRATION section of the left pane, click OAuth client, and then select the Client Credentials option. This is required when uploading the demo images using the setup.js.

    SITECORE_ENDPOINT_URL

    The Preview API URL, for example, https://content-api.sitecorecloud.io/api/content/v1/preview/graphql/.

    SITECORE_DEV_AUTH_TOKEN

    In the Content Hub ONE app, on the menu bar, click Settings and, in the INTEGRATION section of the left pane, click API keys, and then create an API key for Preview. This can be done through the Content Hub ONE app, CLI, or Content Management API.

  4. Save the file.

    Important

    The client ID and client secret are required to run a script using the Content Management API to create content. For development, it is best to use the Preview API, including the SITECORE_ENDPOINT_URL and the SITECORE_DEV_AUTH_TOKEN for the Preview API. For production, use the Delivery API values instead.

Do you have some feedback for us?

If you have suggestions for improving this article,