dist/codex/bigcommerce-commerce/skills/bc-widgets/SKILL.md
Build BigCommerce widgets and use Script Manager — widget templates, widget placements, Page Builder integration, Script Manager API for injecting JavaScript/CSS, and storefront content customization. Use when adding custom content blocks or injecting scripts into the storefront.
npx skillsauth add orcaqubits/agentic-commerce-claude-plugins bc-widgetsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fetch live docs:
https://developer.bigcommerce.com/docs/storefront/widgets for Widget SDKsite:developer.bigcommerce.com scripts api for Script Manager APIbigcommerce page builder widgets custom for custom widget patternsWidgets are reusable content components managed via API:
Widget Template (Handlebars + JSON schema)
↓
Widget (template + configuration data)
↓
Placement (widget + region + page)
↓
Rendered on storefront
POST /v3/content/widget-templates:
{
"name": "Banner with CTA",
"storefront_api_query": "query { site { settings { storeName } } }",
"schema": [
{
"type": "tab",
"label": "Content",
"sections": [
{
"label": "Banner",
"settings": [
{
"type": "text",
"label": "Heading",
"id": "heading",
"default": "Welcome"
},
{
"type": "text",
"label": "Button Text",
"id": "buttonText",
"default": "Shop Now"
},
{
"type": "text",
"label": "Button URL",
"id": "buttonUrl",
"default": "/shop"
}
]
}
]
}
],
"template": "<div class='banner'><h2>{{heading}}</h2><a href='{{buttonUrl}}'>{{buttonText}}</a></div>"
}
| Type | Description |
|------|-------------|
| text | Text input |
| textarea | Multi-line text |
| number | Numeric input |
| boolean | Toggle/checkbox |
| select | Dropdown select |
| color | Color picker |
| imageManager | Image upload/select |
| productId | Product picker |
| categoryId | Category picker |
| range | Slider |
| alignment | Text alignment |
Widget templates use Handlebars:
{{setting_id}} — access setting values{{{html_setting}}} — unescaped HTML{{#if condition}}...{{/if}} — conditionals{{#each items}}...{{/each}} — iterationstorefront_api_query resultsWidgets can include a storefront_api_query that fetches data at render time:
POST /v3/content/widgets:
{
"name": "Homepage Banner",
"widget_template_uuid": "template-uuid-here",
"widget_configuration": {
"heading": "Summer Sale!",
"buttonText": "Shop Deals",
"buttonUrl": "/sale"
}
}
POST /v3/content/placements:
{
"widget_uuid": "widget-uuid-here",
"template_file": "pages/home",
"region": "home_below_menu",
"sort_order": 1,
"status": "active"
}
Regions are defined in Stencil theme templates using:
{{{region name="home_below_menu"}}}
Common regions: home_below_menu, home_below_featured, product_below_price, category_below_header
Inject JavaScript, CSS, or HTML snippets into storefront pages without theme modification.
| Endpoint | Methods | Description |
|----------|---------|-------------|
| /v3/content/scripts | GET, POST, PUT, DELETE | Script CRUD |
POST /v3/content/scripts:
{
"name": "Analytics Tracker",
"description": "Track page views",
"html": "<script src='https://analytics.example.com/tracker.js'></script>",
"src": "",
"auto_uninstall": true,
"load_method": "default",
"location": "head",
"visibility": "all_pages",
"kind": "script_tag",
"consent_category": "analytics",
"channel_id": 1
}
| Property | Options | Description |
|----------|---------|-------------|
| location | head, footer | Where to inject |
| visibility | all_pages, storefront, checkout, order_confirmation | Which pages |
| load_method | default, async, defer | Script loading strategy |
| kind | script_tag, src | Inline HTML or external URL |
| auto_uninstall | true/false | Remove when app is uninstalled |
| consent_category | essential, functional, analytics, targeting | Cookie consent category |
auto_uninstall: true for app-managed scriptsconsent_category for GDPR complianceload_method: 'defer' for non-critical scriptsFetch the BigCommerce Widget SDK and Script Manager API documentation for exact schema types, placement regions, and script properties before implementing.
development
Build with Spree's headless Next.js storefront — the official `spree/storefront` repo (Next.js 16 App Router with Server Actions and Turbopack, React 19 Server Components, Tailwind CSS 4, TypeScript 5, `@spree/sdk`, Sentry), server-only auth (httpOnly JWT cookies + publishable key), MeiliSearch faceted catalog, one-page checkout with Apple/Google Pay/Klarna/Affirm/SEPA, multi-region market routing, GA4 + JSON-LD SEO, and Vercel/Docker deployment. Use when forking or customizing the storefront, or evaluating headless adoption.
tools
Build Spree extensions as Rails engines — gem scaffolding, `bin/rails g spree:extension`, mounting routes/migrations/assets, the modern `prepend` decorator pattern (`*_decorator.rb` with `self.prepended(base)`), generators (`spree:model_decorator`, `spree:controller_decorator`), the four customization surfaces in preference order (Events > Webhooks > Dependencies > Decorators), Spree::Dependencies for swapping service objects, gem release/versioning, and the deprecated Deface engine. Use when building a reusable Spree extension or adding non-trivial customization to an app.
development
Build with Spree's event bus and Webhooks 2.0 — `Spree::Events` publication, `Spree::Subscriber` DSL with `subscribes_to` and `on`, wildcard matching, lifecycle events (`{model}.created/.updated/.deleted` via `publishes_lifecycle_events`), the canonical event catalog (order.*, payment.*, shipment.*, product.*), Webhooks 2.0 endpoints, HMAC-SHA256 signing (`X-Spree-Webhook-Signature`), exponential-backoff retries, and Sidekiq job orchestration. Use when wiring event-driven business logic, building webhook consumers, or replacing ActiveSupport callback chains.
tools
Cross-cutting Spree development patterns — the customization preference hierarchy (Events > Webhooks > Dependencies > Decorators), `Spree::Dependencies` service-object swapping, the `_decorator.rb` + `prepend` + `self.prepended` idiom, idempotent subscribers and webhook receivers, multi-store scoping discipline, prefixed IDs, calculator polymorphism (shipping/promotion/tax share the base), service-object composition with `dry-monads` or simple results, why to avoid `class_eval` reopening and Deface, and Spree-on-Rails idioms (Hotwire/Turbo Stimulus, ActiveStorage, Action Cable, Sidekiq). Use when designing the architecture of a Spree extension or solving cross-cutting concerns.