You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: android/CLAUDE.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Guidance for Claude Code when working in this repository.
4
4
5
5
## Project overview
6
6
7
-
Shopify Checkout Kit for Android is a published AAR library (`com.shopify:checkout-sheet-kit`) that presents Shopify checkouts as a native, dialog-hosted WebView in consumer apps. It is consumed by third-party Android apps via Maven Central, so changes to the library's public surface have real consumer impact and real reversal cost once released.
7
+
Shopify Checkout Kit for Android is a published AAR library (`com.shopify:checkout-kit`) that presents Shopify checkouts as a native, dialog-hosted WebView in consumer apps. It is consumed by third-party Android apps via Maven Central, so changes to the library's public surface have real consumer impact and real reversal cost once released.
8
8
9
9
Two modules matter:
10
10
@@ -15,13 +15,13 @@ The sample is a separate Gradle composite (`samples/MobileBuyIntegration/setting
15
15
16
16
## Where to make changes
17
17
18
-
- Library source: `lib/src/main/java/com/shopify/checkoutsheetkit/`. Flat package at the top level with a few subpackages (`errorevents/`, `lifecycleevents/`, `pixelevents/`).
19
-
- Library tests: `lib/src/test/java/com/shopify/checkoutsheetkit/`. "No test, no merge" is a listed reject criterion in `.github/CONTRIBUTING.md`.
20
-
- Java interop is a first-class concern — the library is commonly consumed from Java code. `lib/src/test/java/com/shopify/checkoutsheetkit/InteropTest.java` exercises the public API from Java specifically; treat breakage there as a consumer-facing issue.
18
+
- Library source: `lib/src/main/java/com/shopify/checkoutkit/`. Flat package at the top level with a few subpackages (`errorevents/`, `lifecycleevents/`, `pixelevents/`).
19
+
- Library tests: `lib/src/test/java/com/shopify/checkoutkit/`. "No test, no merge" is a listed reject criterion in `.github/CONTRIBUTING.md`.
20
+
- Java interop is a first-class concern — the library is commonly consumed from Java code. `lib/src/test/java/com/shopify/checkoutkit/InteropTest.java` exercises the public API from Java specifically; treat breakage there as a consumer-facing issue.
21
21
22
22
## Key components
23
23
24
-
-**`ShopifyCheckoutSheetKit.kt`** — the public singleton. Entry point for all consumer interactions (configure, preload, present).
24
+
-**`ShopifyCheckoutKit.kt`** — the public singleton. Entry point for all consumer interactions (configure, preload, present).
25
25
-**`CheckoutDialog.kt`** — the dialog that hosts the WebView, including the progress indicator and error-recovery coordination.
26
26
-**`CheckoutWebView.kt`** — primary WebView. Holds the URL-keyed cache with a **5-minute preload TTL**; instruments page loads; routes bridge messages.
27
27
-**`BaseWebView.kt`** — abstract base class. Any new WebView variant must extend this so shared configuration (JS interface name, user agent suffix, client handling) is consistent.
@@ -82,7 +82,7 @@ Raising any of these is a consumer-facing breaking change and needs visible rele
82
82
83
83
Versions are bumped via:
84
84
85
-
1. The fallback value in `lib/build.gradle` for the `CHECKOUT_SHEET_KIT_VERSION` env var.
85
+
1. The fallback value in `lib/build.gradle` for the `CHECKOUT_KIT_VERSION` env var.
86
86
2. The install snippets in `README.md` (Gradle and Maven).
87
87
88
88
Publishing goes through GitHub Releases → `.github/workflows/publish.yml` → manual approval gate before Maven Central deploy. Full procedure: `.github/CONTRIBUTING.md` "Releasing a new version".
**Shopify's Checkout Kit for Android** is a library that enables Android apps to provide the world's highest converting, customizable, one-page checkout within an app. The presented experience is a fully-featured checkout that preserves all of the store customizations: Checkout UI extensions, Functions, Web Pixels, and more. It also provides idiomatic defaults such as support for light and dark mode, and convenient developer APIs to embed, customize and follow the lifecycle of the checkout experience. Check out our developer blog to [learn how Checkout Kit is built](https://www.shopify.com/partners/blog/mobile-checkout-sdks-for-ios-and-android).
10
10
11
-
**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.
11
+
**Note**: We're in the process of renaming "Checkout 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.
12
12
13
13
-[Requirements](#requirements)
14
14
-[Getting Started](#getting-started)
@@ -48,14 +48,14 @@
48
48
49
49
## Getting Started
50
50
51
-
The SDK is an [open source Android library](https://central.sonatype.com/artifact/com.shopify/checkout-sheet-kit). As a quick start, see
51
+
The SDK is an [open source Android library](https://central.sonatype.com/artifact/com.shopify/checkout-kit). As a quick start, see
52
52
[sample projects](samples/README.md) or use one of the following ways to integrate the SDK into
@@ -221,14 +221,14 @@ The colors that can be modified are:
221
221
- closeIcon -Used to provide a completely custom close icon drawable
222
222
- closeIconTint -Used to tint the default close icon with a custom color
223
223
224
-
The current configuration can be obtained by calling `ShopifyCheckoutSheetKit.getConfiguration()`.
224
+
The current configuration can be obtained by calling `ShopifyCheckoutKit.getConfiguration()`.
225
225
226
226
### LogLevel
227
227
228
228
Enable additional debug logs via the `logLevel` configuration option.
229
229
230
230
```kotlin
231
-
ShopifyCheckoutSheetKit.configure {
231
+
ShopifyCheckoutKit.configure {
232
232
it.logLevel =LogLevel.DEBUG
233
233
}
234
234
```
@@ -252,7 +252,7 @@ initialized in the background, ahead of time.
252
252
Preloadingis an advanced feature that can be disabled via a runtime flag:
253
253
254
254
```kotlin
255
-
ShopifyCheckoutSheetKit.configure {
255
+
ShopifyCheckoutKit.configure {
256
256
it.preloading =Preloading(enabled =false) // defaults to true
257
257
}
258
258
```
@@ -261,16 +261,16 @@ Once enabled, preloading a checkout is as simple as calling
261
261
`preload(checkoutUrl)` with a valid `checkoutUrl`.
262
262
263
263
```kotlin
264
-
ShopifyCheckoutSheetKit.preload(checkoutUrl)
264
+
ShopifyCheckoutKit.preload(checkoutUrl)
265
265
```
266
266
267
267
Setting enabled to `false` will cause all calls to the `preload` function to be ignored. This allows the application to selectively toggle preloading behavior as a remote feature flag or dynamically in response to client conditions - e.g. when data saver functionality is enabled by the user.
@@ -303,13 +303,13 @@ Instead, a better approach is to call `preload()` when you have a strong enough
303
303
304
304
### Cache invalidation
305
305
306
-
Should you wish to manually clear the preload cache, there is a `ShopifyCheckoutSheetKit.invalidate()` helper function to do so. This function will be a no-op if no checkout is preloaded.
306
+
Should you wish to manually clear the preload cache, there is a `ShopifyCheckoutKit.invalidate()` helper function to do so. This function will be a no-op if no checkout is preloaded.
307
307
308
308
You may wish to do this if the buyer changes shortly before entering checkout, e.g. by changing cart quantity on a cart view.
309
309
310
310
### Lifecycle management for preloaded checkout
311
311
312
-
Preloading renders a checkout in a background webview, which is brought to foreground when `ShopifyCheckoutSheetKit.present()` is called. The content of preloaded checkout reflects the state of the cart when `preload()` was initially called. If the cart is mutated after `preload()` is called, the application is responsible for invalidating the preloaded checkout to ensure that up-to-date checkout content is displayed to the buyer:
312
+
Preloading renders a checkout in a background webview, which is brought to foreground when `ShopifyCheckoutKit.present()` is called. The content of preloaded checkout reflects the state of the cart when `preload()` was initially called. If the cart is mutated after `preload()` is called, the application is responsible for invalidating the preloaded checkout to ensure that up-to-date checkout content is displayed to the buyer:
313
313
314
314
1. To update preloaded contents: call `preload()` once again
315
315
2. To disable preloaded content: toggle the preload configuration setting
@@ -421,7 +421,7 @@ Should you wish to opt-out of this fallback experience entirely, you can do so b
421
421
`preRecoveryActions()` can also be overridden to execute code before a fallback takes place, for example to add logging, or clear up any potentially problematic state such asin cookies. By default this function is a no-op.
| `CheckoutExpiredException` | 'cart_expired' | The cart or checkout is no longer available. | Create a new cart andopen a new checkout URL. |
448
448
| `CheckoutExpiredException` | 'cart_completed' | The cart associated with the checkout has completed checkout. | Create new cart andopen a new checkout URL. |
449
449
| `CheckoutExpiredException` | 'invalid_cart' | The cart associated with the checkout is invalid (e.g. empty). | Create a new cart andopen a new checkout URL. |
450
-
| `CheckoutSheetKitException` | 'error_receiving_message' | CheckoutKit failed to receive a message from checkout. | Show checkout in a fallback WebView. |
451
-
| `CheckoutSheetKitException` | 'error_sending_message' | CheckoutKit failed to send a message to checkout. | Show checkout in a fallback WebView. |
452
-
| `CheckoutSheetKitException` | 'render_process_gone' | The render process for the checkout WebViewis gone. | Show checkout in a fallback WebView. |
453
-
| `CheckoutSheetKitException` | 'unknown' | An error inCheckoutKit has occurred, see error details for more info. | Show checkout in a fallback WebView. |
450
+
| `CheckoutKitException` | 'error_receiving_message' | CheckoutKit failed to receive a message from checkout. | Show checkout in a fallback WebView. |
451
+
| `CheckoutKitException` | 'error_sending_message' | CheckoutKit failed to send a message to checkout. | Show checkout in a fallback WebView. |
452
+
| `CheckoutKitException` | 'render_process_gone' | The render process for the checkout WebViewis gone. | Show checkout in a fallback WebView. |
453
+
| `CheckoutKitException` | 'unknown' | An error inCheckoutKit has occurred, see error details for more info. | Show checkout in a fallback WebView. |
454
454
| `HttpException` | 'http_error' | An unexpected server error has been encountered. | Show checkout in a fallback WebView. |
455
455
| `ClientException` | 'client_error' | An unhandled client error was encountered. | Show checkout in a fallback WebView. |
456
456
| `CheckoutUnavailableException` | 'unknown' | Checkoutis unavailable for another reason, see error details for more info. | Show checkout in a fallback WebView. |
@@ -574,7 +574,7 @@ and initialize a buyer-aware checkout session.
574
574
1. Follow the [Multipass documentation](https://shopify.dev/docs/api/multipass) to create a
575
575
multipass
576
576
URL and set the `'return_to'` to be the obtained `checkoutUrl`
577
-
2. Provide the Multipass URL to `ShopifyCheckoutSheetKit.present()`.
577
+
2. Provide the Multipass URL to `ShopifyCheckoutKit.present()`.
578
578
579
579
> [!Important]
580
580
> the above JSON omits useful customer attributes that should be provided where possible and
@@ -595,7 +595,7 @@ checkout sessions.
595
595
### Customer Account API
596
596
597
597
The Customer Account API allows you to authenticate buyers and provide a personalized checkout experience.
598
-
For detailed implementation instructions, see our [Customer Account API Authentication Guide](https://shopify.dev/docs/storefronts/headless/mobile-apps/checkout-sheet-kit/authenticate-checkouts).
598
+
For detailed implementation instructions, see our [Customer Account API Authentication Guide](https://shopify.dev/docs/storefronts/headless/mobile-apps/checkout-kit/authenticate-checkouts).
0 commit comments