Skip to content

Commit b9bba7a

Browse files
Juanita-Dashclaude
andcommitted
Rename Checkout Sheet Kit to Checkout Kit (React Native)
Renames the React Native bridge in react-native/ from Shopify Checkout Sheet Kit to Shopify Checkout Kit. Mirrors the parallel rename in the source repo (Shopify/checkout-sheet-kit-react-native#483) applied to the v4.0.0 import (#31). Stacked on rn-import-source-v4 (PR #31). When #31 merges, this will be auto-retargeted onto main with the rename diff intact. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b0b150a commit b9bba7a

70 files changed

Lines changed: 482 additions & 483 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

platforms/react-native/.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ dist
8787
.turbo
8888

8989
# Module
90-
modules/@shopify/checkout-sheet-kit/android/gradle/wrapper/gradle-wrapper.jar
91-
modules/@shopify/checkout-sheet-kit/android/gradle/wrapper/gradle-wrapper.properties
92-
modules/@shopify/checkout-sheet-kit/android/gradlew
93-
modules/@shopify/checkout-sheet-kit/android/gradlew.bat
90+
modules/@shopify/checkout-kit/android/gradle/wrapper/gradle-wrapper.jar
91+
modules/@shopify/checkout-kit/android/gradle/wrapper/gradle-wrapper.properties
92+
modules/@shopify/checkout-kit/android/gradlew
93+
modules/@shopify/checkout-kit/android/gradlew.bat
9494

9595
# Sample bundle
9696
**/index.android.bundle

platforms/react-native/CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ see [guidelines and instructions](.github/CONTRIBUTING.md).
77

88
This repo is subdivided into 3 parts using pnpm workspaces:
99

10-
- The base repo (workspace name = `checkout-sheet-kit-react-native`)
11-
- The `@shopify/checkout-sheet-kit` Native Module (workspace name = `module`)
10+
- The base repo (workspace name = `checkout-kit-react-native`)
11+
- The `@shopify/checkout-kit` Native Module (workspace name = `module`)
1212
- The sample application (workspace name = `sample`)
1313

1414
Each of the workspaces contains a separate `package.json` to manage tasks
@@ -75,7 +75,7 @@ SCCACHE=false pnpm sample android
7575
## Making changes to the Native Module
7676

7777
If your intentions are to modify the TS code for the Native Module under
78-
`modules/@shopify/checkout-sheet-kit`, note that you will not need to rebuild to
78+
`modules/@shopify/checkout-kit`, note that you will not need to rebuild to
7979
observe your changes in the sample app. This is because the sample app is
8080
importing the TS files directly from the module directory (through symlinking).
8181

@@ -118,7 +118,7 @@ There are 3 types of tests in this repo: Typescript, Swift and Java - each for
118118
testing the Native Module.
119119

120120
```sh
121-
# Run Jest tests for "modules/@shopify/checkout-sheet-kit/src/**/*.tsx"
121+
# Run Jest tests for "modules/@shopify/checkout-kit/src/**/*.tsx"
122122
pnpm test
123123

124124
# Run swift tests for the Native Module

platforms/react-native/README.md

Lines changed: 44 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Shopify Checkout Kit - React Native
22

3-
[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](https://github.com/Shopify/checkout-sheet-kit-react-native/blob/main/LICENSE)
4-
[![GitHub Release](https://img.shields.io/github/release/shopify/checkout-sheet-kit-react-native.svg?style=flat)]()
3+
[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](https://github.com/Shopify/checkout-kit/blob/main/LICENSE)
4+
[![GitHub Release](https://img.shields.io/github/release/shopify/checkout-kit.svg?style=flat)]()
55

66
<img width="3200" height="800" alt="gradients" src="https://github.com/user-attachments/assets/156492b7-5a64-43d2-b574-2e8f29ed8780" />
77

@@ -13,8 +13,6 @@ branding, and more. It also provides platform idiomatic defaults such as support
1313
for light and dark mode, and convenient developer APIs to embed, customize, and
1414
follow the lifecycle of the checkout experience.
1515

16-
Note: We're in the process of renaming "Checkout Sheet Kit" to "Checkout Kit." The dev docs and README already use the new name, while the package itself will be updated in an upcoming version.
17-
1816
Check out our blog to
1917
[learn how and why we built the Shopify Checkout Kit](https://www.shopify.com/partners/blog/mobile-checkout-sdks-for-ios-and-android).
2018

@@ -71,7 +69,7 @@ experiences.
7169

7270
## Version Compatibility
7371

74-
Starting with **v4.0.0**, `@shopify/checkout-sheet-kit` requires the React Native
72+
Starting with **v4.0.0**, `@shopify/checkout-kit` requires the React Native
7573
**New Architecture** (TurboModules + Fabric). Apps on the old architecture must
7674
stay on the `v3.x` line until they migrate.
7775

@@ -95,13 +93,13 @@ application:
9593
Install the Shopify Checkout Kit package dependency:
9694

9795
```sh
98-
pnpm add @shopify/checkout-sheet-kit
96+
pnpm add @shopify/checkout-kit
9997

10098
# or using yarn
101-
yarn add @shopify/checkout-sheet-kit
99+
yarn add @shopify/checkout-kit
102100

103101
# or using npm
104-
npm install @shopify/checkout-sheet-kit
102+
npm install @shopify/checkout-kit
105103
```
106104

107105
### 2. Minimum Android requirements
@@ -141,13 +139,13 @@ requirements have been checked, you can begin by importing the library in your
141139
application code:
142140

143141
```tsx
144-
import {ShopifyCheckoutSheetProvider} from '@shopify/checkout-sheet-kit';
142+
import {ShopifyCheckoutProvider} from '@shopify/checkout-kit';
145143

146144
function AppWithContext() {
147145
return (
148-
<ShopifyCheckoutSheetProvider>
146+
<ShopifyCheckoutProvider>
149147
<App />
150-
</ShopifyCheckoutSheetProvider>
148+
</ShopifyCheckoutProvider>
151149
);
152150
}
153151
```
@@ -156,10 +154,10 @@ Doing so will now allow you to access the Native Module anywhere in your
156154
application using React hooks:
157155

158156
```tsx
159-
import {useShopifyCheckoutSheet} from '@shopify/checkout-sheet-kit';
157+
import {useShopifyCheckout} from '@shopify/checkout-kit';
160158

161159
function App() {
162-
const shopifyCheckout = useShopifyCheckoutSheet();
160+
const shopifyCheckout = useShopifyCheckout();
163161

164162
// Present the checkout
165163
shopifyCheckout.present(checkoutUrl);
@@ -171,22 +169,22 @@ to obtain a checkout URL to pass to the kit.
171169

172170
> [!NOTE]
173171
> The recommended usage of the library is through a
174-
> `ShopifyCheckoutSheetProvider` Context provider, but see
172+
> `ShopifyCheckoutProvider` Context provider, but see
175173
> [Programmatic usage](#programamatic-usage) below for details on how to use the
176174
> library without React context.
177175
178176
## Programmatic Usage
179177

180-
To use the library without React context, import the `ShopifyCheckoutSheet`
178+
To use the library without React context, import the `ShopifyCheckout`
181179
class from the package and instantiate it. We recommend to instantiating the
182180
class at a relatively high level in your application, and exporting it for use
183181
throughout your app.
184182

185183
```tsx
186184
// shopify.ts
187-
import {ShopifyCheckoutSheet} from '@shopify/checkout-sheet-kit';
185+
import {ShopifyCheckout} from '@shopify/checkout-kit';
188186

189-
export const shopifyCheckout = new ShopifyCheckoutSheet({
187+
export const shopifyCheckout = new ShopifyCheckout({
190188
// optional configuration
191189
});
192190
```
@@ -281,7 +279,7 @@ browser. To present a native checkout sheet in your application, provide the
281279

282280
```tsx
283281
function App() {
284-
const shopifyCheckout = useShopifyCheckoutSheet()
282+
const shopifyCheckout = useShopifyCheckout()
285283
const checkoutUrl = useRef<string>(null)
286284
const [createCart] = useMutation(createCartMutation)
287285
const [addToCart] = useMutation(addToCartMutation)
@@ -330,7 +328,7 @@ function App() {
330328

331329
The SDK provides a way to customize the presented checkout experience through a
332330
`configuration` object in the Context Provider or a `setConfig` method on an
333-
instance of the `ShopifyCheckoutSheet` class.
331+
instance of the `ShopifyCheckout` class.
334332

335333
| Name | Required | Default | Description |
336334
| ------------- | -------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -346,8 +344,8 @@ import {
346344
ColorScheme,
347345
Configuration,
348346
LogLevel,
349-
ShopifyCheckoutSheetProvider,
350-
} from '@shopify/checkout-sheet-kit';
347+
ShopifyCheckoutProvider,
348+
} from '@shopify/checkout-kit';
351349

352350
const config: Configuration = {
353351
colorScheme: ColorScheme.web,
@@ -370,14 +368,14 @@ const config: Configuration = {
370368
// If using React Context
371369
function AppWithContext() {
372370
return (
373-
<ShopifyCheckoutSheetProvider configuration={config}>
371+
<ShopifyCheckoutProvider configuration={config}>
374372
<App />
375-
</ShopifyCheckoutSheetProvider>
373+
</ShopifyCheckoutProvider>
376374
);
377375
}
378376

379-
// If using ShopifyCheckoutSheet directly
380-
const shopifyCheckout = new ShopifyCheckoutSheet(config);
377+
// If using ShopifyCheckout directly
378+
const shopifyCheckout = new ShopifyCheckout(config);
381379
```
382380

383381
### Colors
@@ -424,8 +422,8 @@ slightly different, as you can specify different overrides for `light` and
424422
import {
425423
ColorScheme,
426424
Configuration,
427-
ShopifyCheckoutSheetProvider,
428-
} from '@shopify/checkout-sheet-kit';
425+
ShopifyCheckoutProvider,
426+
} from '@shopify/checkout-kit';
429427

430428
const config: Configuration = {
431429
colorScheme: ColorScheme.automatic,
@@ -452,9 +450,9 @@ const config: Configuration = {
452450

453451
function AppWithContext() {
454452
return (
455-
<ShopifyCheckoutSheetProvider configuration={config}>
453+
<ShopifyCheckoutProvider configuration={config}>
456454
<App />
457-
</ShopifyCheckoutSheetProvider>
455+
</ShopifyCheckoutProvider>
458456
);
459457
}
460458
```
@@ -552,11 +550,11 @@ Once enabled, preloading a checkout is as simple as calling
552550

553551
```tsx
554552
// using hooks
555-
const shopifyCheckout = useShopifyCheckoutSheet();
553+
const shopifyCheckout = useShopifyCheckout();
556554
ShopifyCheckout.preload(checkoutUrl);
557555

558556
// using a class instance
559-
const shopifyCheckout = new ShopifyCheckoutSheet();
557+
const shopifyCheckout = new ShopifyCheckout();
560558
shopifyCheckout.preload(checkoutUrl);
561559
```
562560

@@ -590,7 +588,7 @@ Instead, a better approach is to call `preload()` when you have a strong enough
590588

591589
### Cache invalidation
592590

593-
Should you wish to manually clear the preload cache, there is a `ShopifyCheckoutSheetKit.invalidate()` helper function to do so.
591+
Should you wish to manually clear the preload cache, there is a `ShopifyCheckoutKit.invalidate()` helper function to do so.
594592

595593
## Checkout lifecycle
596594

@@ -613,7 +611,7 @@ an event listener in a React `useEffect`, ensuring to remove it on unmount.
613611

614612
```tsx
615613
// Using hooks
616-
const shopifyCheckout = useShopifyCheckoutSheet();
614+
const shopifyCheckout = useShopifyCheckout();
617615

618616
useEffect(() => {
619617
const close = shopifyCheckout.addEventListener('close', () => {
@@ -751,7 +749,7 @@ is completed.
751749
### Universal Links - iOS
752750

753751
See the
754-
[Universal Links guide](https://github.com/Shopify/checkout-sheet-kit-react-native/blob/main/documentation/universal_links_ios.md)
752+
[Universal Links guide](https://github.com/Shopify/checkout-kit/blob/main/documentation/universal_links_ios.md)
755753
for information on how to get started with adding support for Offsite Payments
756754
in your app.
757755

@@ -812,20 +810,20 @@ The geolocation request flow follows this sequence:
812810
> This section is only applicable for Android.
813811

814812
In order to opt-out of the default permission handling, you can set `features.handleGeolocationRequests` to `false`
815-
when you instantiate the `ShopifyCheckoutSheet` class.
813+
when you instantiate the `ShopifyCheckout` class.
816814

817815
If you're using the sheet programmatically, you can do so by specifying a `features` object as the second argument:
818816

819817
```tsx
820-
const checkoutSheetKit = new ShopifyCheckoutSheet(config, {handleGeolocationRequests: false});
818+
const shopifyCheckout = new ShopifyCheckout(config, {handleGeolocationRequests: false});
821819
```
822820

823-
If you're using the context provider, you can pass the same `features` object as a prop to the `ShopifyCheckoutSheetProvider` component:
821+
If you're using the context provider, you can pass the same `features` object as a prop to the `ShopifyCheckoutProvider` component:
824822

825823
```tsx
826-
<ShopifyCheckoutSheetProvider configuration={config} features={{handleGeolocationRequests: false}}>
824+
<ShopifyCheckoutProvider configuration={config} features={{handleGeolocationRequests: false}}>
827825
{children}
828-
</ShopifyCheckoutSheetProvider>
826+
</ShopifyCheckoutProvider>
829827
```
830828

831829
When opting out, you'll need to implement your own permission handling logic and communicate the result back to the checkout sheet. This can be useful if you want to:
@@ -872,10 +870,10 @@ Accelerated checkout buttons surface Apple Pay and Shop Pay options earlier in t
872870

873871
### Configure the integration
874872

875-
Pass an `acceleratedCheckouts` configuration when setting up the provider or `ShopifyCheckoutSheet` instance. This connects the accelerated checkout buttons to your storefront.
873+
Pass an `acceleratedCheckouts` configuration when setting up the provider or `ShopifyCheckout` instance. This connects the accelerated checkout buttons to your storefront.
876874

877875
```tsx
878-
import {ShopifyCheckoutSheetProvider} from '@shopify/checkout-sheet-kit';
876+
import {ShopifyCheckoutProvider} from '@shopify/checkout-kit';
879877

880878
const config = {
881879
acceleratedCheckouts: {
@@ -901,9 +899,9 @@ const config = {
901899

902900
function App() {
903901
return (
904-
<ShopifyCheckoutSheetProvider configuration={config}>
902+
<ShopifyCheckoutProvider configuration={config}>
905903
<YourApp />
906-
</ShopifyCheckoutSheetProvider>
904+
</ShopifyCheckoutProvider>
907905
);
908906
}
909907
```
@@ -919,7 +917,7 @@ Use `AcceleratedCheckoutButtons` to attach accelerated checkout calls-to-action
919917
import {
920918
AcceleratedCheckoutButtons,
921919
AcceleratedCheckoutWallet,
922-
} from '@shopify/checkout-sheet-kit';
920+
} from '@shopify/checkout-kit';
923921

924922
function CartFooter({cartId}: {cartId: string}) {
925923
return (
@@ -964,7 +962,7 @@ Accelerated checkout buttons display every available wallet by default. Use `wal
964962
Use `applePayLabel` to map to the native `PayWithApplePayButtonLabel` values. The default is `plain`.
965963

966964
```tsx
967-
import {ApplePayLabel} from '@shopify/checkout-sheet-kit';
965+
import {ApplePayLabel} from '@shopify/checkout-kit';
968966

969967
<AcceleratedCheckoutButtons
970968
cartId={cartId}
@@ -977,7 +975,7 @@ import {ApplePayLabel} from '@shopify/checkout-sheet-kit';
977975
Use `applePayStyle` to set the color style of the Apple Pay button. The default is `automatic`, which adapts to the current appearance (light/dark mode).
978976

979977
```tsx
980-
import {ApplePayStyle} from '@shopify/checkout-sheet-kit';
978+
import {ApplePayStyle} from '@shopify/checkout-kit';
981979

982980
<AcceleratedCheckoutButtons
983981
cartId={cartId}

platforms/react-native/__mocks__/react-native.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const StyleSheet = {
4747

4848
const exampleConfig = {preloading: true};
4949

50-
const ShopifyCheckoutSheetKit = {
50+
const ShopifyCheckoutKit = {
5151
version: '0.7.0',
5252
getConstants: jest.fn(() => ({version: '0.7.0'})),
5353
preload: jest.fn(),
@@ -77,15 +77,15 @@ module.exports = {
7777
codegenNativeComponent,
7878
TurboModuleRegistry: {
7979
getEnforcing: jest.fn((name: string) => {
80-
if (name === 'ShopifyCheckoutSheetKit') {
81-
return ShopifyCheckoutSheetKit;
80+
if (name === 'ShopifyCheckoutKit') {
81+
return ShopifyCheckoutKit;
8282
}
8383
return null;
8484
}),
8585
},
8686
NativeModules: {
87-
ShopifyCheckoutSheetKit: {
88-
...ShopifyCheckoutSheetKit,
87+
ShopifyCheckoutKit: {
88+
...ShopifyCheckoutKit,
8989
eventEmitter: createMockEmitter(),
9090
},
9191
},

platforms/react-native/dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: checkout-sheet-kit-react-native
1+
name: checkout-kit-react-native
22

33
dev.edition: 2024
44

@@ -44,7 +44,7 @@ up:
4444
pnpm run pod-install
4545
- custom:
4646
name: Build node module
47-
met?: (cd modules/@shopify/checkout-sheet-kit && ls -l | grep lib)
47+
met?: (cd modules/@shopify/checkout-kit && ls -l | grep lib)
4848
meet: |
4949
pnpm module build
5050

0 commit comments

Comments
 (0)