Get the environment variables for a site

The Deploy app's Developer settings tab provides environment variables that connect your app to an XM Cloud site running in an environment deployed to XM Cloud.

Use these environment variables when deploying your app or to get started with local development without Docker containers. To set up a local development environment based on Docker containers, see Set up your full-stack XM Cloud local development environment.

Before you begin
The developer settings tab

Get the environment variables for a site

The Developer Settings tab provides the environment variables for all XM Cloud sites in your environment and is specific to each environment.

To get the environment variables for a specific site:

  1. On the navigation pane of the XM Cloud Deploy app, click Projects.

  2. On the Projects page, click the project that contains the environment where you want to view the site's environment variables.

  3. Click the relevant environment, then click Developer settings.

  4. In the Site drop-down menu, choose the site you want your app to connect to. The drop-down menu lists all sites including each site in a multisite application setup. If using a multisite setup, choose the site you want to use as the app's default site.

  5. In the JSS version selector, choose the appropriate JSS version. You can find your app's JSS version in the version property of the package.json file.

  6. If your app uses JSS 21.6+, in the Context selector, choose one of the following:

    • Preview - grants access to all content, including drafts and unpublished content.

    • Live - grants access to published content. Use this for product apps.

You can use the environment variables to get started with local development or to deploy your app to Vercel.

Note

When getting started with local development, create a .env.local file in your app's directory (for example src/sxastarter) and add the environment variables there.

Do you have some feedback for us?

If you have suggestions for improving this article,