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-native
package:$ 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 test
packages/core
: the@segment/analytics-react-native
moduledocs
: the generated TypeScript documentation, commited using alint-staged
hooksrc
: 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.yml
gen-integrations.ts
: generates@segment/react-native-*
packages inbuild/
gen-readme.ts
: updatesREADME.md
Integrations section
test-app
:project
: the generated react-native test-app root