# Environments

Safely iterate on content models without affecting production content.

Last updated November 2025

Environments allow you to modify content models without affecting production content. You can test model changes against your content in isolation before pushing the changes to production.

The environment selector in the Page Builder.

An environment clones content from your production repository into a new repository, including:

- Content models ( [page types](/content/docs/content-modeling#page-types/index.html), [slices](/content/docs/slices/index.html), and [custom types](/content/docs/content-modeling#custom-types/index.html))
- Pages
- Media files

The following are **not** cloned into new environments:

- Users (user permissions are shared between environments)
- [Integration](/content/docs/fields/integration/index.html) field catalogs (catalogs are shared between environments)
- Webhooks

## [How to create an environment](/content/docs/environments#how-to-create-an-environment/index.html)

- ### [Open your environment settings](/content/docs/environments#open-your-environment-settings/index.html)

Navigate to your Prismic repository and go to **Settings** > **Environments**.

You must be the repository owner or have admin rights to access the Environments page.

- ### [Create an environment](/content/docs/environments#create-an-environment/index.html)

In the **Environments** section, create an environment using the following values:

| Field | Value |
| --- | --- |
| **Name** | The name that content writers see. It also determines the environment’s URL. |
| **Choose an environment to clone** | The base environment used to copy content and settings. |

Click **Create a new environment** after filling in the values.

- ### [Sync content](/content/docs/environments#sync-content/index.html)

Prismic will automatically start to clone content from the selected base environment into the new environment.

You can access the new environment once everything is synced.

## [Local development](/content/docs/environments#local-development/index.html)

Prismic’s local development tool, [Slice Machine](/content/docs/slice-machine/index.html), supports environments. The active development environment can be changed in Slice Machine using the drop down in the top-left corner.

You can immediately modify and push content model changes to the selected environment.

The environment selector in Slice Machine.

### [Access the selected development environment](/content/docs/environments#access-the-selected-development-environment/index.html)

Slice Machine automatically sets an environment variable in your project with the selected development environment. The name of the environment variable depends on your website’s framework:

- **Next.js**: `NEXT_PUBLIC_PRISMIC_ENVIRONMENT`
- **Nuxt**: `NUXT_PUBLIC_PRISMIC_ENVIRONMENT`
- **SvelteKit**: `VITE_PRISMIC_ENVIRONMENT`

These variable names follow each framework’s standard conventions for environment variables.

The environment variable is deleted when the production repository is selected.

### [Fetch content from a development environment](/content/docs/environments#fetch-content-from-a-development-environment/index.html)

You can configure your Prismic client to fetch content from the selected environment. How you update the client depends on which framework your website uses.

Next.js Nuxt SvelteKit

Update `prismicio.ts` to use `NEXT_PUBLIC_PRISMIC_ENVIRONMENT`:

```ts
export const repositoryName =
  process.env.NEXT_PUBLIC_PRISMIC_ENVIRONMENT || sm.repositoryName;
```

`repositoryName` will automatically switch to the development environment selected in Slice Machine.

**No code changes necessary**. `@nuxtjs/prismic` automatically points to the selected development environment.

Update `prismicio.ts` to use `VITE_PRISMIC_ENVIRONMENT`:

```ts
export const repositoryName =
  import.meta.env.VITE_PRISMIC_ENVIRONMENT || sm.repositoryName;
```

`repositoryName` will automatically switch to the development environment selected in Slice Machine.

## [Push changes to production](/content/docs/environments#push-changes-to-production/index.html)

Once your content model changes have been tested in your development environment, you can push them to your production repository.

### [(Optional) Commit your changes to Git](/content/docs/environments#optional-commit-your-changes-to-git/index.html)

If you are using [Git](https://git-scm.com/) or another version control system (VCS), commit your model changes. You’ll be able to undo your changes through your VCS if necessary.

### [Change to the production environment](/content/docs/environments#change-to-the-production-environment/index.html)

In Slice Machine, change to the production environment using the drop down in the top-left corner.

The environment selector in Slice Machine.

### [Push to Prismic](/content/docs/environments#push-to-prismic-2/index.html)

Click **Review changes** in the sidebar. You should see your model changes listed.

If the changes look correct, click the **Push** button in the top-right corner.

The review changes page in Slice Machine.

The Page Builder will now recognize your changes.

## [Resync content](/content/docs/environments#resync-content/index.html)

Over time, an environment’s content will diverge from the production repository. You can resync content and its models from the production repository at any time.

We recommend resyncing at the start of each website development cycle, such as starting to add a new [slice](/content/docs/slices/index.html) or website feature.

- ### [Open your environment settings](/content/docs/environments#open-your-environment-settings-1/index.html)

Navigate to your Prismic repository and go to **Settings** > **Environments**.

You must be the repository owner or have admin rights to access the Environments page.

- ### [Resync content](/content/docs/environments#resync-content/index.html)

In the **Environments** section, locate your environment and click its **Resync** button.

Prismic will start to sync content from the base environment into your environment.

## [FAQs](/content/docs/environments#faqs/index.html)

### [Should I use environments for staging content?](/content/docs/environments#should-i-use-environments-for-staging-content/index.html)

No. Environments are only meant for making changes to content models without endangering the production repository’s content.

**We recommend that content writers stay on the production repository to author new content**. Content writers can use [releases](/content/docs/releases/index.html) and [previews](/content/docs/previews/index.html) to review content on the front-end before publishing.

### [Why is content missing after pushing changes?](/content/docs/environments#why-is-content-missing-after-pushing-changes/index.html)

In most cases, this happens because a [page type](/content/docs/content-modeling#page-types/index.html), [custom type](/content/docs/content-modeling#custom-types/index.html), or [field](/content/docs/fields/index.html)’s API ID was renamed. Changing an API ID is effectively the same as removing the model (along with the model’s content) and adding a new one with the updated API ID.

If you need to rename a model, we recommend not editing its API ID and renaming its label instead. Existing content will be retained and content writers will see the new label.

We recommend testing content model changes in a development environment to protect your production content.

[Learn more about the impact of pushing changes](/content/docs/content-modeling#impact-of-pushing-changes/index.html)

### [Can I use “development” endpoints for an integration field?](/content/docs/environments#can-i-use-development-endpoints-for-an-integration-field/index.html)

Yes. Read the following guide to understand how the integration field and environments can work together and how you can configure a different integration endpoint on your cloned environments.
