Skip to content

3.4.0

Latest

Choose a tag to compare

@markmur markmur released this 08 Oct 15:00
· 3 commits to main since this release
955506d

✨ Shopify Accelerated Checkouts

3.4.0 of @shopify/checkout-sheet-kit introduces the latest feature of the Checkout Kit: Accelerated Checkouts.

npm install @shopify/checkout-sheet-kit@latest

Accelerated Checkouts offer a way to render "wallet" buttons in your app with minimal code - including support for Apple Pay and Shop Pay out of the box.

shopify-accelerated-checkouts

📋 Requirements

🛠️ Integrating

Integrating these buttons is quite straight forward:

  1. Update your Checkout Kit Configuration object:
import { Configuration, ColorScheme } from '@shopify/checkout-sheet-kit'

const config: Configuration = {
  colorScheme: ColorScheme.web,
  preloading: true,
+  acceleratedCheckouts: {
+    storefrontDomain: env.STOREFRONT_DOMAIN!,
+    storefrontAccessToken: env.STOREFRONT_ACCESS_TOKEN!
+    wallets: {
+      applePay: {
+         contactFields: [ApplePayContactField.email, ApplePayContactField.phone],
+         merchantIdentifier:  env.STOREFRONT_MERCHANT_IDENTIFIER!,
+      }
+    }
  }
}

function AppWithCheckout() {
    return (
       <ShopifyCheckoutSheetProvider config={config}>
          <App />
       </ShopifyCheckoutSheetProvider>
     )
}
  1. Add <AcceleratedCheckoutButtons /> to your cart or product details screens:
+ import { AcceleratedCheckoutButtons } from '@shopify/checkout-sheet-kit'

function CartScreen() {
    return (
       <View>
+      <AcceleratedCheckoutButtons 
+         cartId="gid://Shopify/Cart/123"  />
       </View>
    )
}

function ProductDetailsScreen() {
    return (
       <View>
+       <AcceleratedCheckoutButtons 
+         variantId="gid://Shopify/ProductVariant/123" 
+         quantity={1} />
       </View>
    )
}

Full Changelog: 3.3.3...3.4.0