React Native Expo

Thryve React Native SDK supports Expo projects. The SDK will set-up all the native project configurations automatically for both Android and iOS after adding the @thryve/react-native-sdk plugin to your app.config.js - no additional plugins or manual native file changes are required.

circle-info

The plugin handles the Nexus Maven repository, Gradle SDK versions, Android manifest permissions, Health Connect infrastructure, iOS entitlements, and privacy manifests automatically. No manual native file changes are needed.

Please refer to the React Native set-up for guidance on installing packages before proceeding with adding the following configuration:

// app.config.js
module.exports = {
  expo: {
    ios: {
      infoPlist: {
        NSHealthShareUsageDescription: 'Allow to share your health data',
        NSHealthUpdateUsageDescription: 'Allow to update your health data',
        NSCameraUsageDescription: 'Camera is required for ShenAI facial health measurements', // Required for ShenAI only
        UIBackgroundModes: ['fetch'],
      },
    },
    plugins: [
      [
        '@thryve/react-native-sdk',
        {
          nexusUsername: process.env.THRYVE_NEXUS_USERNAME,
          nexusPassword: process.env.THRYVE_NEXUS_PASSWORD,
          android: {
            // Include only the modules your app uses
            modules: ['health-connect', 'samsung-health'],
            // Omit `permissions` entirely to include all permissions for the selected modules.
            // Provide it only when you want a subset — but every data type you pass to
            // start() must have its permission listed here, otherwise Health Connect will
            // reject the call at runtime (error 90005).
            // Unused permissions require justification during Google Play Store review.
            permissions: [
              'android.permission.health.READ_HEART_RATE',
              'android.permission.health.READ_STEPS',
              'android.permission.health.READ_ACTIVE_CALORIES_BURNED',
              'android.permission.health.READ_SLEEP',
              'android.permission.health.READ_BLOOD_GLUCOSE',
              'android.permission.health.READ_BLOOD_PRESSURE',
              'android.permission.health.READ_WEIGHT',
              'android.permission.health.READ_HEIGHT',
              'android.permission.health.READ_OXYGEN_SATURATION',
              'android.permission.health.READ_BODY_TEMPERATURE',
              // Add further permissions your app needs.
              // All available strings are in HEALTH_CONNECT_PERMISSIONS:
              // const { HEALTH_CONNECT_PERMISSIONS } = require('@thryve/react-native-sdk/permissions');
            ],
          },
          // Include only the iOS pods your app uses
          // Apple Health is configured via ios[] and infoPlist above
          ios: ['ThryveCore', 'ThryveAppleHealth', 'ThryveShenAI'],
        },
      ],
    ],
  },
};

Last updated