@shopify/checkout-ui-extensions
TypeScript icon, indicating that this package has built-in type declarations

0.27.3 • Public • Published

@shopify/checkout-ui-extensions

This library contains type definitions and other utilities for writing UI extensions in Shopify’s checkout. However, nothing in this library is strictly required to write a UI extension. As a developer building a UI extension, you can forego the utilities this library provides entirely, and instead use the global shopify API directly in a plain JavaScript file. The script below is a valid UI extension script without any additional processing:

shopify.extend('Checkout::Dynamic::Render', (root, api) => {
  const button = root.createComponent('Button', {
    onPress() {
      console.log('Upsold!');
    },
  });

  button.appendChild('Buy now');

  root.appendChild(button);
});

Keeping in mind that any utility provided by this library is only a convenience API on top of the shopify global, the rest of the documentation for this library will show examples using JavaScript imports from the @shopify/checkout-ui-extensions library. Using JavaScript modules in this way requires a build step, but can provide useful developer experience features and opportunities for build-time performance optimizations.

Getting started

Before you dig in to what this library has to offer, read through the Checkout UI extensions overview, and a getting started guide from one of the checkout extension examples.

API

This package provides utilities, types, and documentation for the many different APIs a UI extension can access. Before you write your first extension, you should read through the following documentation in order:

Once you’ve read the documents above, you’re ready to write a checkout extension. If you’re wanting to learn even more, this repo has a few additional guides that cover techniques for writing larger, more complex extensions:

Dependencies (2)

Dev Dependencies (2)

Package Sidebar

Install

npm i @shopify/checkout-ui-extensions

Weekly Downloads

3,912

Version

0.27.3

License

MIT

Unpacked Size

7.92 MB

Total Files

806

Last publish

Collaborators

  • jaimie.rockburn
  • blittle
  • shopify-admin
  • maryharte
  • crisfmb
  • pmoloney89
  • netlohan
  • st999999
  • justin-irl
  • megswim
  • wcandillon
  • nathanpjf
  • shopify-dep
  • goodforonefare
  • lemonmade
  • vsumner
  • wizardlyhel
  • antoine.grant
  • tsov
  • andyw8-shopify
  • henrytao
  • hannachen
  • vividviolet
  • bpscott