Reusing the same slot and component setup across client Shopify stores
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
1 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 templateThen, 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:
- 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.
- 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.
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.