diff --git a/platforms/web/README.md b/platforms/web/README.md index a7f4b4443..d9befb4fe 100644 --- a/platforms/web/README.md +++ b/platforms/web/README.md @@ -86,13 +86,24 @@ Once the first stable `4.0.0` ships, the standard `pnpm add @shopify/checkout-ki ## Basic Usage -Import the package once anywhere in your application. The import has a side -effect — it registers `` with `customElements`: +Import the component once anywhere in your application. This entry registers +only `` with `customElements`: ```ts -import '@shopify/checkout-kit'; +import '@shopify/checkout-kit/shopify-checkout'; ``` +Components use separate entry points within the same npm package. Import only +the components you need. The package root (`@shopify/checkout-kit`) exports the +classes, events, and types without registering anything; see +[manual registration](#manual-registration-and-custom-tag-names). + +> [!IMPORTANT] +> `import '@shopify/checkout-kit'` no longer registers ``. +> Import `@shopify/checkout-kit/shopify-checkout` instead, or call +> `ShopifyCheckout.register()`. Without either, `` elements +> stay unregistered and checkout won't open. + Then render the element anywhere in your HTML and call `open()` to present checkout: @@ -106,7 +117,7 @@ checkout: