Przejdź do treści
Biblioteka skilli
Programowanie · Automatyzacja

b2c-storefronts

/b2c-storefronts

Przenosi witryny Storefront Next między instancjami B2C Commerce przez CLI b2c, z eksportem, importem i konfiguracją projektu.

Licencja
Apache-2.0
Ostatnia zmiana repozytorium
13.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
2
Przestarzałość

Brak sygnałów. Repozytorium zmienione 13.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co robi i kiedy

Przenosi witryny Storefront Next między instancjami B2C Commerce przez CLI b2c, z eksportem, importem i konfiguracją projektu.

Wyzwalacze z opisu

set up my storefront on productionwhy did my storefront import fail
Oryginalny opis (EN)

Set up and move Storefront Next (composable) storefronts between B2C Commerce instances with the b2c CLI. Use this skill whenever the user needs to choose between creating a storefront and importing one, connect a production or other instance to an existing Managed Runtime project, export or import a storefront with a site archive, or find a storefront's project configuration and credentials — even if they just say "set up my storefront on production" or "why did my storefront import fail".

Jak działa

  1. Create or Import
  2. Create a Storefront
  3. Move a Storefront to Another Instance
  4. Project Configuration and Credentials
  5. Related Skills
Sekcje z nagłówków SKILL.md, w oryginale · 83 linii, 814 słów
Podgląd SKILL.md
---
name: b2c-storefronts
description: Set up and move Storefront Next (composable) storefronts between B2C Commerce instances with the b2c CLI. Use this skill whenever the user needs to choose between creating a storefront and importing one, connect a production or other instance to an existing Managed Runtime project, export or import a storefront with a site archive, or find a storefront's project configuration and credentials — even if they just say "set up my storefront on production" or "why did my storefront import fail".
---

# B2C Storefronts Skill

A Storefront Next storefront links B2C Commerce sites on an instance to a Managed Runtime (MRT) project. Setup also creates the storefront's API clients, SLAS client, eCDN configuration, and MRT environment.

> **Tip:** If `b2c` is not installed globally, use `npx @salesforce/b2c-cli` instead (for example, `npx @salesforce/b2c-cli job export --storefront my-storefront`).

## Create or Import

Choose by whether the MRT project should already exist:

| Goal                                                                      | Use                                                                        |
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| A new storefront with a **new** MRT project                               | Storefront setup in Business Manager, or `b2c mrt project create`          |
| Add another instance (for example, production) to an **existing** project | Export the storefront from the source instance and import it on the target |

Creating a storefront always provisions a new MRT project, even if one with the same name and sites already exists. To keep staging and production in one project, create the storefront once, then export and import it.

Storefronts do **not** replicate. Code and data replication from staging (see `b2c-cli:b2c-replication`) leaves them out, so import the storefront on each target instance.

## Create a Storefront

Business Manager storefront setup is the primary path; it also scaffolds the project configuration. To create one from the CLI over the SCAPI Storefronts API:

```bash
b2c mrt project create "My Storefront" --site MySite --mrt-backend scapi
```

Creation runs asynchronously. It needs an Account Manager API client with `sfcc.storefront.storefronts.rw`; the client that storefront setup creates does not have it. See the `b2c-cli:b2c-mrt` skill for SCAPI backend setup.

## Move a Storefront to Another Instance

Requires B2C Commerce 26.10 or later on both instances.

```bash
# 1. Export the storefront record from the source instance (by storefront name)
b2c job export --storefront my-storefront -i staging --output ./storefront-export

# 2. Import the extracted archive directory on the target and wait for setup
b2c job import ./storefront-export/<archive-name> -i production --wait-for-storefront --show-log
```

The export extracts to `./storefront-export/<archive-name>/storefronts/<storefront-name>.xml`. It contains only the storefront record: storefront name, type, associated sites, MRT project (`mrt-site`), MRT organization (`org-slug`), and the acting `user-id`. Neither MRT environments nor bundles are copied.

The import creates the storefront and runs `sfcc-post-import-setup-storefront`. That job provisions API and SLAS clients, site state, eCDN, and a new MRT environment in the existing project. It can take 20 minutes or more. Without `--wait-for-storefront`, the command returns once the archive import finishes and setup keeps running on the instance.

### Import Requirements

The import fails, without creating anything, unless all of these hold on the target:

- **Sites exist.** Every associated site must exist on the target and not already belong to another storefront. Replicate or import the site first.
- **Name is free.** No storefront with the same name exists on the target. Do not delete a storefront to retry an import: deleting a storefront over the SCAPI backend (`mrt project delete`) removes its MRT project for every instance.
- **Same MRT organization.** The `org-slug` must match the target instance's MRT organization.
- **Authorized identity.** An import run from a Business Manager session uses that user. An API import (client credentials) uses the `user-id` in the archive, which must be an Account Manager user with a Managed Runtime role in the instance's organization.

An export made with client credentials records the API client's service user (for example, `scapi-<client-id>@...`), which fails that check on import. Before importing, set `user-id` in `storefronts/<storefront-name>.xml` to an authorized user's login.

Source repository (GitHub) links are not imported. Connect the new environment to source control separately if needed.

When the import fails, read the job log (`--show-log`, or `b2c job log sfcc-site-archive-import`). The summary error is generic (`Internal fatal error`); the cause appears as a `[DATAERROR]` line.

### Verify

```bash
# Both instances should list the same project, each with its own environment
b2c mrt env list -p my-mrt-project -i staging --mrt-backend scapi
b2c mrt env list -p my-mrt-project -i production --mrt-backend scapi
```

The MRT project ID is the `mrt-site` value in the export, not the storefront name.

## Project Configuration and Credentials

To develop locally or configure CI against a storefront, use **Download .env** on the storefront's detail page in Business Manager. Use that file for the storefront project rather than copying values by hand. Its client secrets download only once, and no CLI command or API returns them; to rebuild the other values or rotate a lost SLAS secret, see the Storefront Next setup reference in `b2c-cli:b2c-setup` or [Get the Environment File](https://salesforcecommercecloud.github.io/b2c-developer-tooling/guide/storefront-next.md#get-the-environment-file). See the [Storefront Next guide](https://salesforcecommercecloud.github.io/b2c-developer-tooling/guide/storefront-next.md) (`b2c docs read guide-storefront-next`) for how the CLI uses common Storefront Next project variables.

## Related Skills

- `b2c-cli:b2c-setup` — end-to-end sandbox and realm setup
- `b2c-cli:b2c-mrt` — MRT projects, environments, bundles, and environment variables
- `b2c-cli:b2c-site-import-export` — site archive layout and other export data units
- `b2c-cli:b2c-job` — job execution, logs, and waiting
- `b2c-cli:b2c-replication` — replicate the sites a storefront needs before importing it
Pliki w paczce (2)
  • SKILL.md 6 KB
  • evals/trigger-evals.json 2 KB

Wersje

W bazie nie ma innych skilli o nazwie b2c-storefronts.

Migawka bazy z 13.11.2026 · wersja paczki f3c4881123f6 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 2 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100b2c-setup
    Planuje i przeprowadza konfigurację sandboxa B2C Commerce: dane przykładowe, witryny, indeksy i replikację, z potwierdzeniem przed zmianami.
  • 91commerce-storefront
    Tworzy nowe sklepy internetowe i szkielety projektów e-commerce oraz aplikacje handlowe z użyciem StateSet.
  • 100bc-headless
    Buduje headless commerce z BigCommerce: Catalyst (referencyjny storefront Next.js), GraphQL Storefront API, API po stronie serwera, osadzony checkout i wzorce architektury headless.
  • 100sfnext-overview
    Wskazuje właściwy skill storefront-next dla zadania w Salesforce Commerce Storefront Next i zawiera ściągawkę do poleceń sfnext, b2c, narzędzi b2c-dx-mcp oraz wyszukiwania w dokumentacji.
  • 100salesforce-headless
    Buduje bezgłowe sklepy na Salesforce B2C Commerce: integrację z SCAPI, PWA Kit, migrację z SFRA i wdrożenie w Managed Runtime.
  • 100saleor-storefront
    Podpowiada, jak budować sklepy na API GraphQL Saleor: produkty, warianty, checkout, kanały i uprawnienia, niezależnie od frameworka frontendowego.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.