Streaming Mobile Example
A React Native reference app for the Streaming API: pair a wearable, stream live biometrics to Terra, and render them on screen. No backend, no keys on the device.
Terra Grip is a React Native app that streams real-time wearable data to Terra using the terra-rt SDK. Scan a QR code from your dashboard and the phone pairs to a heart-rate strap, watch, or its own sensors.
It is the producer half of a Streaming API integration. There is no backend: the QR carries a reusable rt. token with the user's identity bound into it, so no API keys reach the device. For the consumer half, see Terra Pulse.
terra examples clone streaming-mobile-app my-app
cd my-app/app && npm install && npx expo run:iosWhat it demonstrates
Opening a producer connection to Terra's WebSocket broker
Pairing a wearable over BLE, plus phone sensors and Apple Watch
QR pairing with a reusable
rt.token, held in the device keychainBackground streaming with the screen locked
Rendering readings live from the local SDK feed
A demo mode that runs the producer flow on synthetic data, with no hardware

Run it yourself
Add a test user
On the streaming page, click + Test User and choose Use my own wearable device. Leave the pairing QR on screen.
How the integration works
ProducerController.ts drives the sequence, then opens the stream. Because the token is reusable, fetchSdkToken and fetchStreamingToken return the same string the QR carried.
The token is the only difference from local-only streaming. With it, rt.startRealtime opens the WebSocket to Terra and relays every reading.
Production integrations usually mint a short-lived token per connection from their own backend instead, which is the flow in the React Native reference.
Explore the code
Includes a Jest suite over the producer state machine.
app/src/producer/terraSdk.ts
The terra-rt integration surface; start here
app/src/producer/ProducerController.ts
The producer state machine
app/src/auth/
Pairing session, keychain storage, token provider
app/src/datatypes/
One entry per streaming data type
wearos/
The standalone Wear OS companion
Last updated
Was this helpful?