
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@backpackjs/cms-env
Advanced tools
Backpack's Content Management System Environment module (CMS-ENV) is the first (1) command executed during the [backpack storefront initialization lifecycle](https://github.com/packdigital/backpackjs-monorepo/packages/cli#storefront-init-lifecycle). It is
Backpack's Content Management System Environment module (CMS-ENV) is the first (1) command executed during the backpack storefront initialization lifecycle. It is executed in both development and production modes (i.e in both backpack dev & build).
Backpackjs CMS-ENV is primarily responsible for:
A CMS environment is the content management instance of a storefront. The instance's default schema includes a set of pre-defined content types that allow end-users to store and manage both meta and front-end content entry for all common e-commerce content endpoints.
| TYPE | FIELDS | DESCRIPTION |
|---|---|---|
| 📃 Page | • handle • seo [title, description and image] • content [local, global sections] | A page is a route representing a single page i.e /pages/about-us |
| 🗂 Blog | • handle • seo [title, description and image] • content [local, global sections] | A blog is a route representing a collection of articles i.e /blogs/news |
| 📝 Article | • handle • seo [title, description and image] • article [author, blog, excerpt, category, tags] • content [local, global sections] | An article represents a single blog post CMS entry i.e /blogs/news/we-are-live |
| 🛍 Collection | • handle • seo [title, description and image] • content [local, global sections] | A collection is a route representing a collection of products i.e /collection/new-arrivals |
| 👜 Product | • handle • seo [title, description and image] • content [local, global sections] | A product content type is a route a single product content entry i.e /products/crew-neck-tee |
An important feature of backpack CMS environments is the concept of content branches. A content branch, is an isolated clone of the full CMS instance for a given storefront.
There are two types of content branches:
| TYPE | DEFAULT | # BRANCHES | CONFIGURABLE | DESCRIPTION |
|---|---|---|---|---|
| 🌎 production branch | "main" | 1 | no | The "main" branch is your live/production content branch |
| 🚧 feature branches | any git branch name i.e "staging" | 1-7 maxBranches | yes | Any git branch such as "staging", "new-hero", "new-landing-page" etc.. |
Content isolation enables full separation of content management concerns between production and development content branches and between development branches themselves.
This means that developers can develop, configure, deploy and preview new complex features without worrying on it's impact on the production content branch or any other concurrent development branches.
Backpack feature branches provide similar but much improved functionality to Shopify themes development workflows via duplicated theme instances.
All CMS content branches have a 1-to-1 relationship with storefront git branches. This ensures a correct association between code and content branches `. i.e A deployed "staging" git branch using the "staging" CMS content branch as data source.
Production Branch: By default backpack CMS creates its production branch under the name main which means that the storefront's git repository must have main as it's primary/master branch.Feature Branch(es): Each feature branch i.e "new-homepage-hero" starts a clone of the main production branch (at the time of creation).Feature content branches (can be) very dynamic by nature - just like git branches. That is, you can easily create , delete or update (soon) any feature branch.
Depending on your storefront cms-env configuration's maxBranches you will have up to 7 isolated and fully previewable feature branches to work with at any given time.
Although you may be limited to 7 concurrent feature branches, this does not mean that you can't have multiple developers collaborating within individual feature branch at the same time.
Since most features branches are likely to come and go, we provide you with a prompt-based cli interface that guides you throughout the feature management lifecycle.
When a storefront is first created, it will have only the "main/production" content branch. This is because your storefront git repository will have no other branches.
As you start working on new features, you may want to develop these in separate git branches.
Creating content branches is closely tied with creating regular git branches.
yarn devyarn dev on this new git branch, backpack CMS doesn't have yet have a matching content branch for it. The cli will prompt you wether you want to create a new content branchAny subsequent calls to yarn dev or yarn build on this branch won't require this step.
You must always create a new content branch via the cli, before a feature build preview can be successfully deployed. This is because a build will fail if there is no matching content branch for a given git branch.
To create any additional branches simply follow the previous steps. When you have reached your allocated number of feature branches, the cli may prompt you wether you want to delete an existing content branch in order to create a new one.
Replacing an existing branch with a new one, is also managed via the cli. To replace an existing branch simply:
yarn dev - You should see: 🌎 Initializing Backpack environments...Any subsequent calls to yarn dev or yarn build on this branch won't trigger the cli. Instead you should see:
🌎 Setting [configs-doc] as active environment [CMS_ENV]
This is the use case were I like working on say a jp branch. The branch gets out of sync with main.. Need to build the branch update prompt / feature.
Recommended workflow
Caveats
Although not recommended, a storefront can be forced to initialize with a "non-matching"/"detected" feature content branch. This can be achieved by configuring the forceEnv option on backpack.init.js
FAQs
Backpack's Content Management System Environment module (CMS-ENV) is the first (1) command executed during the [backpack storefront initialization lifecycle](https://github.com/packdigital/backpackjs-monorepo/packages/cli#storefront-init-lifecycle). It is
The npm package @backpackjs/cms-env receives a total of 2 weekly downloads. As such, @backpackjs/cms-env popularity was classified as not popular.
We found that @backpackjs/cms-env demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.