All questions

Reusing the same slot and component setup across client Shopify stores

Asked by Aisling Byrne on

ABAisling Byrne

Hi all. We have standardised a setup for one of our Shopify clients that works really well: a home hero slot, a promo banner slot, and a PDP badge, each with its own component schema. Four more clients are onboarding this quarter and I would rather not recreate all of that by hand in each workspace.

Is there a sanctioned way to package the structure and apply it to another client workspace? Each client has their own workspace already, and I want them to stay fully separate, just organised the same way

Was this helpful?

1 answer

MPMarcos PassosAccepted answer

This is exactly what templates in the CLI are for. From the project where your proven setup lives, package it with:

npx croct@latest create template

Then, in a project connected to another client's workspace, apply it with the use command. The template stamps the slots and component schemas into the target workspace, so you get the same hero, banner, and badge structure without rebuilding anything manually.

Two things worth knowing for the agency case:

  1. Slots and component schemas are defined per workspace, so each client gets an independent copy. Editing the hero schema for client A never touches client B.
  2. The croct.json5 file in each project tracks the organization, workspace, and applications per environment, so each client repo stays pointed at the right place. Keep one project per client and the CLI does the bookkeeping.

After applying the template you still create the experiences and audiences per client, since those tend to be client-specific anyway.

Was this helpful?
ABAisling Byrne

Brilliant, applied it to the first new client this morning and the whole structure came across in one go. That is hours saved per onboarding.

Still have questions?