Since this SDK is npm package, it does not need to be compiled separately.
This project uses Microsoft API Extractor to detect breaking changes to the public API surface.
- API Extractor generates a baseline file (
api-extractor-output/customerio-reactnative.api.md) containing the current API surface - CI validates that this baseline matches the actual exported APIs
- Any API changes require updating the baseline file and committing it
After making API changes:
-
Build TypeScript declarations:
npm run prepare
-
Update the API baseline:
npx api-extractor run --local
-
Review and commit the updated
api-extractor-output/customerio-reactnative.api.mdfile
To validate without updating:
npx api-extractor runWe use the Ami App to test the SDK in a real-world environment.
When you install dependencies via yarn/npm in react native app, you can install it from your local machine directly. You need to follow the following steps to use local version of the SDK
- Go to
package.jsonof your react native app - Find the SDK dependency i.e.
"customerio-reactnative": "{version}" - Update the SDK version to path of the SDK e.g.
"customerio-reactnative": "../customerio-reactnative" - Run
yarn installto update dependencies and use local version of SDK instead
Android SDK can be tested locally by following instructions from native SDK. Once SDK release is installed locally, it can be included in Ami App using any of the following options:
Updating gradle.properties to use local version by updating following line:
customerio.reactnative.cioSDKVersionAndroid=local
React Native SDK allows overriding SDK version on app side, so Ami App can override the version and use local release instead by adding the following line in gradle.properties
cioSDKVersionAndroid=local
iOS SDK cannot be tested locally at this time. You must instead refer to a version of the iOS SDK already released to production.
If you make changes to native code, it sometimes may not be reflected in the app. View the Ami App docs for next steps on getting Ami App to install the SDK from your local directory.
Please note that currently there is no script or automation that helps you make the changes, so you should revert the changes in
package.jsonandyarn.lockfor local version ofcustomerio-reactnativebefore pushing any changes to git.