React Native
Zing publishes a public React Native sample app that demonstrates how to bridge the native Zing SDKs into a React Native (Expo) project. The sample covers the same surface as the native SDKs: initialization with API keys, launching native screens, and platform-specific build configuration.
- Sample repository: Muze-Fitness/fitness-coach-sdk-react
Requirements
| Requirement | Value / Notes |
|---|---|
| Node | 20+ |
| Xcode | 16+ |
| Android Studio | with Android SDK 36 |
| JDK | 21 |
| Maven credentials (Android native SDK) | GitHub Packages token with read:packages scope |
Setup
- Install JavaScript dependencies:
npm install- Copy the API key template and fill in your values:
cp constants/ZingApiKeys.example.ts constants/ZingApiKeys.tsSet iosApiKey and androidApiKey in constants/ZingApiKeys.ts.
- Generate the native projects with Expo:
npx expo prebuild- Configure Android Maven credentials so the build can pull the native Zing SDK from GitHub Packages. Add the following to the generated
android/local.properties:
sdk_maven_read_username=<github-username>
sdk_maven_read_token=<github-token>The token must be a GitHub PAT with the read:packages scope.
Alternatively, export the same values as environment variables:
export ZING_SDK_MAVEN_USER=<github-username>
export ZING_SDK_MAVEN_TOKEN=<github-token>- Run the app on the simulator/device of your choice:
npx expo run:ios
# or
npx expo run:androidHow the bridge works
The sample wraps the native iOS and Android SDKs in an Expo native module under modules/zing-sdk. The JavaScript surface mirrors the native SDKs and exposes the same operations: initialize, login, logout, observe auth state, and open native screens. Because the bridge delegates to the native SDKs, all SDK features work the same way as in a native app.
For full configuration details (auth modes, callbacks, error codes), see the Authorization guide and the native iOS and Android references.
Building your own React Native integration
If you would rather integrate Zing into an existing React Native app instead of starting from the sample, you can use the sample repository as a reference and copy the modules/zing-sdk bridge into your project. Adjust app.json, native build files, and Maven credentials as shown above, then call the bridge from your JavaScript code.