
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
react-native-terra-rt-react
Advanced tools
React Native bridge for Terra Realtime mobile SDKs
npm install react-native-terra-rt-react
To begin, please set up the environment as instructed by TerraRTiOS and TerraRTAndroid.
The functionalities form these SDKs have been bridged over so you may call them from react native.
This can be done using
initTerra(
devId: String,
referenceId?: String
): Promise<SuccessMessage>
initConnection(token: String): Promise<SuccessMessage>
getUserId(): Promise<GetUserId>
On Android, you may use
startDeviceScan(
connections: Connections,
useCache: Boolean = false,
showWidgetIfCacheNotFound: Boolean = false
): Promise<SuccessMessage>
On iOS, the native view is bridged over to React Native as a component. You can get it as:
const BLWidget = requireNativeComponent('BLWidget');
And you may use it as a component:
<SafeAreaView style={styles.container}>
{Platform.OS === 'ios' && displayWidget && (
<BLWidget
withCache={false}
onSuccessfulConnection={_onSuccessfulConnection} // Function that is called when connection established
/>
)}
</SafeAreaView>
In the case, it is displayed, it will automatically remove itself from view whe _onSuccessfulConnection is called.
startRealtime(
connections: Connections,
dataTypes: Array<DataTypes>,
token: String | null = null
): Promise<SuccessMessage>
In the case you wish to receive data in the app, this function also updates the app in an event listener. You may receive updates by listening for "Update" events:
const eventEmitter = new NativeEventEmitter(NativeModules.UpdateHandler);
eventEmitter.addListener('Update', (event: Update) => {
// Update view with event
});
stopRealtime(
connections: Connections
): Promise<SuccessMessage>
disconnect(connections: Connections): Promise<SuccessMessage>
connectWithWatchOS(): Promise<SuccessMessage>
In the case you wish to use this, you will need to create a companion app for the current react native app in native Swift/ObjC. This is because react-native has yet to support WatchOS developement. TerraRTiOS supports WatchOS integration directly.
Types used above can be seen here.
enum Connections {
ANT = 'ANT',
BLE = 'BLE',
WEAR_OS = 'WEAR_OS',
WATCH_OS = 'WATCH_OS',
ANDROID = 'ANDROID',
ALL_DEVICES = 'ALL_DEVICES',
APPLE = 'APPLE',
}
enum DataTypes {
HEART_RATE = 'HEART_RATE',
ECG = 'ECG',
STEPS = 'STEPS',
HRV = 'HRV',
CALORIES = 'CALORIES',
LOCATION = 'LOCATION',
DISTANCE = 'DISTANCE',
ACTIVITY = 'ACTIVITY',
ACCELERATION = 'ACCELERATION',
GYROSCOPE = 'GYROSCOPE',
FLOORS_CLIMBED = 'FLOORS_CLIMBED',
STEPS_CADENCE = 'STEPS_CADENCE',
SPEED = 'SPEED',
POWER = 'POWER',
BIKE_CADENCE = 'BIKE_CADENCE',
MET = 'MET',
RR_INTERVAL = 'RR_INTERVAL',
}
type GetUserId = {
success: Boolean;
userId: String | null;
};
type SuccessMessage = {
success: Boolean;
error: String | null;
};
type Update = {
ts: String | null;
val: number | null;
type: String | null;
d: Array<number> | null;
};
A very simple example project was generated here. This is used as internal testing and may providing a starting point for you if needed. Please fill in the config file with credentials to start.
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
FAQs
test
We found that react-native-terra-rt-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.