Skip to navigation

Plan: Stencil Developer

Lesson 2 of 23 · 15 min

What Is the Widgets API?

The Widgets API allows developers to create dynamic content blocks that can be used by authors in BigCommerce’s storefront visual editors. The content can consist of HTML, CSS, and JavaScript, and is configurable using Handlebars variables. The Widgets API supports various content types, such as YouTube videos, image sliders, and chat apps.

In Page Builder, developers can also programmatically place these widgets on specific pages of a BigCommerce storefront.

Page Builder and Makeswift

Stencil storefronts offer two distinct visual editors for assembling and configuring on-page content: Page Builder and Makeswift. The full suite of the Widgets API — widget templates, widgets, regions, and placements — is relevant to Page Builder. Only widget templates and regions are relevant to Makeswift.

  • Page Builder is Stencil’s legacy visual editor. A widget registered through the Widgets API appears in Page Builder’s content block palette as a built-in widget, which store users drag, drop, and configure alongside Page Builder’s other default content blocks. It uses all of the Widgets API: widget templates define the widget, widgets are created from them, regions mark where content can go, and placements put widgets into regions. Programmatic placement uses the Widgets API and is a Page Builder capability. Widgets placed this way appear in Makeswift, but you must convert a region to Makeswift before you can control its content there.
  • Makeswift is BigCommerce’s modern, composable visual editor, also supported on Stencil themes. Makeswift uses widget templates and regions: a widget template you create is exposed as a native Makeswift component, with its own controls in the component panel, and regions mark where it can be used.

Throughout this course, you’ll create widget templates and regions, which are relevant to both Makeswift and Page Builder. You’ll also create widgets and placements, which are relevant only to Page Builder.

What Can You Do with Widgets API?

What can you do with the Widgets API?

The Widgets API allows developers to programmatically inject custom content via HTML, JS, and CSS into Stencil templates, enabling them to build apps that enhance ecommerce experiences on BigCommerce storefronts.

  • Inject modular, reusable blocks of content inside new and existing store pages
  • Build tools that allow non-technical users to control content without editing theme files
  • Target specific products, categories, or brands with the widgets
  • Create sophisticated applications and merchandising functionality
  • Make custom widget templates available as built-in Page Builder blocks or native Makeswift components

The Widgets API lays the groundwork for future tools that will give merchants more control over their storefronts than ever before, without editing code, even opening the door to creating new workflows to manage and publish content in BigCommerce stores.

As a developer, the Widgets API opens the door to building all kinds of creative and exciting solutions for BigCommerce merchants.

To learn how the Widgets API is a foundational step towards native visual content merchandising in BigCommerce, read Advancing API-first with BigCommerce Widgets on the BigCommerce Developer Blog.