44
55![ image] ( https://github.com/Shopify/checkout-kit-react-native/assets/2034704/107fbeb8-50be-43ac-8837-33d576cac9ab )
66
7-
8- ** Shopify Checkout Kit** is a Native Module (currently in [ Developer Preview] ( https://shopify.dev/docs/api/release-notes/developer-previews ) ) that enables React Native apps to
9- provide the world’s highest converting, customizable, one-page checkout within
10- the app. The presented experience is a fully-featured checkout that preserves
11- all of the store customizations: Checkout UI extensions, Functions, branding,
12- and more. It also provides platform idiomatic defaults such as support for light
13- and dark mode, and convenient developer APIs to embed, customize, and follow the
14- lifecycle of the checkout experience.
7+ ** Shopify Checkout Kit** is a Native Module (currently in
8+ [ Developer Preview] ( https://shopify.dev/docs/api/release-notes/developer-previews ) )
9+ that enables React Native apps to provide the world’s highest converting,
10+ customizable, one-page checkout within the app. The presented experience is a
11+ fully-featured checkout that preserves all of the store customizations: Checkout
12+ UI extensions, Functions, branding, and more. It also provides platform
13+ idiomatic defaults such as support for light and dark mode, and convenient
14+ developer APIs to embed, customize, and follow the lifecycle of the checkout
15+ experience.
1516
1617Check out our blog to
1718[ learn how and why we built Checkout Kit] ( https://www.shopify.com/partners/blog/mobile-checkout-sdks-for-ios-and-android ) .
@@ -40,10 +41,10 @@ started:
4041Install the Shopify Checkout Kit package dependency:
4142
4243``` sh
43- yarn add react-native- shopify- checkout-kit
44+ yarn add @ shopify/ checkout-sheet -kit
4445
4546# or using npm
46- npm install react-native- shopify- checkout-kit
47+ npm install @ shopify/ checkout-sheet -kit
4748```
4849
4950#### 2. Ensure your app meets the minimum Android SDK version requirement
@@ -83,25 +84,25 @@ requirements have been checked, you can begin by importing the library in your
8384application code:
8485
8586``` tsx
86- import {ShopifyCheckoutKitProvider } from ' react-native- shopify- checkout-kit' ;
87+ import {ShopifyCheckoutSheetProvider } from ' @ shopify/ checkout-sheet -kit' ;
8788
8889function AppWithContext() {
8990 return (
90- <ShopifyCheckoutKitProvider >
91+ <ShopifyCheckoutSheetProvider >
9192 <App />
92- </ShopifyCheckoutKitProvider >
93+ </ShopifyCheckoutSheetProvider >
9394 );
9495}
9596```
9697
97- Doing so will now allow you to access the ShopifyCheckoutKit Native Module
98- anywhere in your application using React hooks:
98+ Doing so will now allow you to access the Native Module anywhere in your
99+ application using React hooks:
99100
100101``` tsx
101- import {useShopifyCheckoutKit } from ' react-native- shopify- checkout-kit' ;
102+ import {useShopifyCheckoutSheet } from ' @ shopify/ checkout-sheet -kit' ;
102103
103104function App() {
104- const shopifyCheckout = useShopifyCheckoutKit ();
105+ const shopifyCheckout = useShopifyCheckoutSheet ();
105106
106107 // Present the checkout
107108 shopifyCheckout .present (checkoutUrl );
@@ -112,20 +113,21 @@ See [Usage with the Storefront API](#usage-with-the-storefront-api) below on how
112113to get a checkoutUrl to pass to the SDK.
113114
114115> Note: The recommended usage of the library is through a
115- > ` ShopifyCheckoutKitProvider ` Context provider, but see
116+ > ` ShopifyCheckoutSheetProvider ` Context provider, but see
116117> [ Programmatic usage] ( #programamatic-usage ) below for details on how to use the
117118> library without React context.
118119
119120### Programmatic Usage
120121
121- To use the library without React context, import the ` ShopifyCheckoutKit ` class
122- from the package and instantiate it. We recommend to instantiating the class at
123- a high level in your application, and exporting it for use throughout your app.
122+ To use the library without React context, import the ` ShopifyCheckoutSheet `
123+ class from the package and instantiate it. We recommend to instantiating the
124+ class at a high level in your application, and exporting it for use throughout
125+ your app.
124126
125127``` tsx
126- import {ShopifyCheckoutKit } from ' react-native- shopify- checkout-kit' ;
128+ import {ShopifyCheckoutSheet } from ' @ shopify/ checkout-sheet -kit' ;
127129
128- export const shopifyCheckout = new ShopifyCheckoutKit ({
130+ export const shopifyCheckout = new ShopifyCheckoutSheet ({
129131 // optional configuration
130132});
131133```
@@ -219,7 +221,7 @@ browser. To present a native checkout sheet in your application, provide the
219221
220222``` tsx
221223function App() {
222- const shopifyCheckout = useShopifyCheckoutKit ()
224+ const shopifyCheckout = useShopifyCheckoutSheet ()
223225 const checkoutUrl = useRef <string >(null )
224226 const [createCart] = useMutation (createCartMutation )
225227 const [addToCart] = useMutation (addToCartMutation )
@@ -267,7 +269,7 @@ session in the background and ahead of time.
267269
268270The SDK provides a way to customize the presented checkout experience through a
269271`configuration` object in the Context Provider or a `setConfig` method on an
270- instance of the `ShopifyCheckoutKit ` class.
272+ instance of the `ShopifyCheckoutSheet ` class.
271273
272274| Name | Required | Default | Description |
273275| ------------- | -------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -281,8 +283,8 @@ Here's an example of how a fully customized configuration object might look:
281283import {
282284 ColorScheme ,
283285 Configuration ,
284- ShopifyCheckoutKitProvider ,
285- } from 'react-native- shopify- checkout-kit';
286+ ShopifyCheckoutSheetProvider ,
287+ } from '@ shopify/ checkout-sheet -kit';
286288
287289const config: Configuration = {
288290 colorScheme : ColorScheme .web ,
@@ -304,14 +306,14 @@ const config: Configuration = {
304306// If using React Context
305307function AppWithContext() {
306308 return (
307- <ShopifyCheckoutKitProvider configuration = { config } >
309+ <ShopifyCheckoutSheetProvider configuration = { config } >
308310 <App />
309- </ShopifyCheckoutKitProvider >
311+ </ShopifyCheckoutSheetProvider >
310312 );
311313}
312314
313- // If using ShopifyCheckoutKit directly
314- const shopifyCheckout = new ShopifyCheckoutKit (config);
315+ // If using ShopifyCheckoutSheet directly
316+ const shopifyCheckout = new ShopifyCheckoutSheet (config);
315317```
316318
317319#### `colorScheme`
@@ -358,8 +360,8 @@ slightly different, as you can specify different overrides for `light` and
358360import {
359361 ColorScheme ,
360362 Configuration ,
361- ShopifyCheckoutKitProvider ,
362- } from 'react-native- shopify- checkout-kit';
363+ ShopifyCheckoutSheetProvider ,
364+ } from '@ shopify/ checkout-sheet -kit';
363365
364366const config: Configuration = {
365367 colorScheme : ColorScheme .automatic ,
@@ -384,9 +386,9 @@ const config: Configuration = {
384386
385387function AppWithContext() {
386388 return (
387- <ShopifyCheckoutKitProvider configuration = { config } >
389+ <ShopifyCheckoutSheetProvider configuration = { config } >
388390 <App />
389- </ShopifyCheckoutKitProvider >
391+ </ShopifyCheckoutSheetProvider >
390392 );
391393}
392394```
@@ -408,11 +410,11 @@ Once enabled, preloading a checkout is as simple as calling
408410
409411```tsx
410412// using hooks
411- const shopifyCheckout = useShopifyCheckoutKit ();
413+ const shopifyCheckout = useShopifyCheckoutSheet ();
412414ShopifyCheckout.preload(checkoutUrl);
413415
414416// using a class instance
415- const shopifyCheckout = new ShopifyCheckoutKit ();
417+ const shopifyCheckout = new ShopifyCheckoutSheet ();
416418shopifyCheckout.preload(checkoutUrl);
417419```
418420
@@ -452,7 +454,7 @@ an event listener in a React `useEffect`, ensuring to remove it on unmount.
452454
453455```tsx
454456// Using hooks
455- const shopifyCheckout = useShopifyCheckoutKit ();
457+ const shopifyCheckout = useShopifyCheckoutSheet ();
456458
457459useEffect(() => {
458460 const close = shopifyCheckout .addEventListener (' close' , () => {
0 commit comments