CLI
@sevigram/loom-cli provides the loom command. Storefronts made with npm create @sevigram/loom already include it, with an npm run check script.
To add it to another project:
npm install --save-dev @sevigram/loom-cliloom check
Section titled “loom check”npx loom check # reads ./.envnpx loom check --env .env.productionIt checks, one line each:
SEVIGRAM_STOREFRONT_TOKENis set and starts withsfpub_, and the optionalSEVIGRAM_STOREFRONT_PRIVATE_TOKENstarts withsfprv_. Swapped tokens are called out.SEVIGRAM_API_BASE_URL, which defaults tohttps://api.sevigram.com/storefront/v1, targets API v1.APP_ORIGINis set, and the API accepts the public token from that origin.- The API accepts the private token, when one is set.
Variables already in the environment win over the file. Tokens are never printed beyond their first 10 characters.
The exit code is 0 when every check passes and 1 otherwise, so you can run it in CI before you deploy.
When a check fails, it says what to do in plain words, for example “add http://localhost:5173 to allowed origins”. For other API errors it prints the HTTP status and error code.