The following is a set of guidelines for contributing to this project. Please take a moment to read through them before submitting your first PR.
This is a monorepo containing the iOS/Swift, Android, and (forthcoming) React Native implementations of the Shopify Checkout Kit. Each platform has its own conventions, tooling, and release process; the shared guidelines below apply to all of them.
This project and everyone participating in it are governed by the Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to opensource@shopify.com.
- Reporting issues with existing features
- Bug fixes
- Performance improvements
- Documentation
- Usability improvements
- Additional dependencies that limit SDK use (e.g. unnecessary Swift or Android dependencies)
- Any changes that break existing tests
- Any changes without sufficient tests
When in doubt about whether we will be interested in including a new feature, please open an issue to propose the feature so we can confirm scope before it is implemented.
NOTE: Issues that have not been active for 30 days will be marked as stale, and subsequently closed after a further 7 days of inactivity.
- Fork the repo and branch off of
main. - Create a feature branch in your fork.
- Make changes and add any relevant tests.
- Run the platform-specific formatter / linter (see below).
- Verify the changes locally (e.g. via the platform's sample app).
- Commit your changes and push.
- Ensure all checks (tests, lint) are passing in GitHub.
- Open a pull request with a detailed description of what is changing and why.
This project uses Mint to manage Swift linting tools (SwiftLint and SwiftFormat) at pinned versions via platforms/swift/Mintfile. This ensures consistent formatting across all contributors and CI.
Shopify employees (from the repo root):
dev upExternal contributors:
brew install mint
cd platforms/swift && mint bootstrapcd platforms/swift && ./Scripts/lint fixThe library's public API is tracked via committed baselines under platforms/swift/api/, one JSON file per module (ShopifyCheckoutProtocol.json, ShopifyCheckoutKit.json, ShopifyAcceleratedCheckouts.json). They are produced by xcrun swift-api-digester -dump-sdk against the built .swiftmodule files. The unified Breaking Changes CI workflow runs dev swift api check on every PR that touches Swift sources and fails if the digester output for any module diverges from its committed baseline.
If your change intentionally modifies the public API:
- Run
dev swift api dumpfrom the repo root to regenerate the baselines. - Review the diff in
platforms/swift/api/*.jsonalongside your code changes. - Commit the updated JSON files in the same PR.
When dev swift api check fails, it prints both the unified diff and a swift-api-digester -diagnose-sdk summary categorizing the changes (removed, renamed, type/protocol/inheritance changes). Use the diagnose summary to decide whether the diff is intentional.
Open a pull request with the following changes:
- Bump the package version in
platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift. - Bump the metadata version in
platforms/swift/Sources/ShopifyCheckoutKit/MetaData.swift. - Bump the podspec version in
ShopifyCheckoutKit.podspec(at the repo root). - Add an entry to the top of
platforms/swift/CHANGELOG.md. - If the React Native package should consume this Swift SDK release, update
checkoutKit.nativeSdkVersions.iosinplatforms/react-native/modules/@shopify/checkout-kit-react-native/package.jsonto the same version.
All Swift version declarations must match exactly. Supported release versions are X.Y.Z and prerelease versions are X.Y.Z-{alpha|beta|rc}.N.
Once merged, run the Release package workflow:
- Select
iOSas the platform. - Enter the expected version. The workflow reads the SDK version from the checked-in files and fails if the typed version does not match.
- Leave
dry-runenabled first to review the release plan. - Rerun with
dry-rundisabled. By default this creates a draft GitHub Release with the bare semver tag (e.g.3.8.1) for human review. - Publish the draft release when ready. Publishing the draft kicks off the Swift publish workflow, which publishes the new version to CocoaPods.
This project uses detekt for Kotlin linting and formatting. From platforms/android/:
./gradlew detekt --auto-correctTo check for lint issues without auto-correcting:
./gradlew detektThe library's public API is tracked via a committed baseline at platforms/android/lib/api/lib.api, managed by the binary-compatibility-validator Gradle plugin. The unified Breaking Changes CI workflow runs ./gradlew :lib:apiCheck on every PR that touches Android sources and fails if the compiled public API diverges from the baseline.
If your change intentionally modifies the public API:
- Run
dev android api dumpfrom the repo root (or./gradlew :lib:apiDumpfromplatforms/android/) to regenerate the baseline. - Review the diff in
platforms/android/lib/api/lib.apialongside your code changes. - Commit the updated
.apifile in the same PR.
If you did not intend to change public API and apiCheck is failing, the diff shows what your change inadvertently affected — treat it as a signal that something in your PR has consumer-visible impact.
Open a pull request with the following changes:
- Bump the
versionNameinplatforms/android/lib/build.gradle. - Add an entry to the top of
platforms/android/CHANGELOG.md. - If the React Native package should consume this Android SDK release, update
checkoutKit.nativeSdkVersions.androidinplatforms/react-native/modules/@shopify/checkout-kit-react-native/package.jsonto the same version.
Supported release versions are X.Y.Z and prerelease versions are X.Y.Z-{alpha|beta|rc}.N.
Once merged, run the Release package workflow:
- Select
Androidas the platform. - Enter the expected version. The workflow reads the SDK version from
platforms/android/lib/build.gradleand fails if the typed version does not match. - Leave
dry-runenabled first to review the release plan. - Rerun with
dry-rundisabled. By default this creates a draft GitHub Release with theandroid/-prefixed tag (e.g.android/3.0.1) for human review. - Publish the draft release when ready. Publishing the draft kicks off the Android publish workflow. A manual approval by a maintainer is required before publication to Maven Central.
The React Native package reads its published native SDK dependency versions from platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json:
"checkoutKit": {
"nativeSdkVersions": {
"ios": "4.0.0-alpha.1",
"android": "4.0.0-alpha.1"
}
}When updating the Swift or Android SDK version that React Native should consume, update the matching checkoutKit.nativeSdkVersions entry in this package file. These values drive RNShopifyCheckoutKit.podspec for iOS and the module/sample Gradle dependencies for Android, so they must stay aligned with the published native SDK versions used by the React Native release.
The library's public API is tracked via a committed report at platforms/react-native/modules/@shopify/checkout-kit-react-native/api/checkout-kit-react-native.api.md, generated by @microsoft/api-extractor from the bob-produced .d.ts files. The unified Breaking Changes CI workflow runs dev rn api check on every PR that touches React Native sources and fails if the regenerated report diverges from the committed one.
If your change intentionally modifies the public API:
- Run
dev rn api dumpfrom the repo root to regenerate the report. - Review the diff in
platforms/react-native/modules/@shopify/checkout-kit-react-native/api/checkout-kit-react-native.api.mdalongside your code changes. - Commit the updated
.api.mdfile in the same PR.
If you did not intend to change public API and api:check is failing, the diff shows what your change inadvertently affected — treat it as a signal that something in your PR has consumer-visible impact.