If you would like to contribute code to analytics-react-native you can do so through
GitHub by forking the repository and sending a pull request.
When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. Please also make sure your code runs by building and testing.
We use prettier to format our code, and commitzen to format commits.
To build an integration you'll first need to integrate it using the native Analytics SDK, here's a documentation to do so for iOS or for Android.
When your integration is ready you'll need to add it to integrations.yml and check it works by building and testing.
This project is a Yarn workspace, npm is not supported. To install dependencies run :
$ yarn- Build the
@segment/react-nativepackage:$ yarn core build
- Build the
@segment/react-native-*packages:$ yarn integrations build
- Build the test application for iOS and Android:
$ yarn test-app build
- Launch these three steps one by one:
$ yarn build
$ yarn testpackages/core: the@segment/analytics-react-nativemoduledocs: the generated TypeScript documentation, commited using alint-stagedhooksrc: JavaScript moduleios: iOS native moduleandroid: Android native module
packages/integrations:integrations.yml: the unique source of truth for supported integrationssrc: a set of generators usingintegrations.ymlgen-integrations.ts: generates@segment/react-native-*packages inbuild/gen-readme.ts: updatesREADME.mdIntegrations section
test-app:project: the generated react-native test-app root