@segmentify/react-native-v2
v1.0.4
Published
Segmentify SDK for React Native applications.
Downloads
484
Readme
Segmentify React Native
Monorepo for the Segmentify React Native SDK, an Expo example app, and Starlight documentation.
| Path | Contents |
| ---------------------- | ----------------------------------------------------------------------------------------------- |
| src/ | Published npm package @segmentify/react-native-v2 (TypeScript sources consumed by Metro). |
| example/ | Expo app demonstrating the SDK. |
| docs/ | Astro + Starlight docs site. |
Install the SDK
From the npm registry (public scoped package):
npm install @segmentify/react-native-v2
# or
pnpm add @segmentify/react-native-v2
# or
yarn add @segmentify/react-native-v2Peer dependencies used by the SDK (install them in your app if you do not already have compatible versions):
reactreact-native@react-native-async-storage/async-storage@react-native-community/netinforeact-native-webview
Run the documentation site
From the repository root:
pnpm install
pnpm run devThis starts the Astro Starlight dev server (see root package.json scripts). Use pnpm run build / pnpm run preview for a production build and local preview.
Run the example application
The example is an Expo SDK 54 app in example/. You need Node.js matching root engines (currently >=22.12.0), pnpm, and the usual iOS (Xcode) and/or Android (Android Studio) tooling for React Native.
Firebase (push notifications)
The example is configured for Firebase Cloud Messaging via @react-native-firebase/app and @react-native-firebase/messaging. Expo expects:
- iOS:
GoogleService-Info.plist— paths referenced fromexample/app.json(ios.googleServicesFile) and the native project underexample/ios/. - Android:
google-services.json— paths underexample/android/app/perapp.json(android.googleServicesFile).
Download these from the Firebase console for your project, or use your team’s copies. Without them, native builds that use FCM may fail; adjust or remove Firebase plugins in app.json if you only need a quick UI demo.
Commands
From the repository root (recommended, so the workspace link to @segmentify/react-native-v2 resolves):
pnpm install
pnpm --filter @segmentify/react-native-example startOr from example/:
cd example
pnpm install # if installing from this folder only; prefer root install for workspaces
pnpm startUseful scripts from example/package.json:
| Script | Description |
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| pnpm start | Start the Expo dev server (EXPO_NO_METRO_WORKSPACE_ROOT=1 is set for monorepo Metro). |
| pnpm run android | Open on Android emulator/device. |
| pnpm run ios | Open on iOS simulator/device. |
| pnpm run web | Run in the browser. |
| pnpm run build:android / pnpm run build:ios | EAS Build (eas build) using example/eas.json preview profile — requires EAS login and credentials. |
CI and publishing
- CI:
.github/workflows/ci.ymlinstalls dependencies with a frozen lockfile and runspnpm --filter @segmentify/react-native-v2 typecheckon pushes and pull requests tomain. - npm publish:
.github/workflows/publish.ymlpublishes@segmentify/react-native-v2when a GitHub Release is published, or when the workflow is run manually (workflow_dispatch). Add anNPM_TOKENrepository secret (npm automation token with publish access to the@segmentifyscope). Bump theversionfield insrc/package.jsonon the commit you release before tagging/creating the release. Provenance is enabled inpublishConfig; the workflow setsid-token: writefor OIDC with npm.
License
See LICENSE.
