
Company News
Socket Joins the OpenJS Foundation
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.
react-native-google-fit
Advanced tools
A React Native bridge module for interacting with Google Fit on Android.
⚠️ Important Notice: Google has deprecated the Google Fit API and is transitioning to Health Connect. While the Google Fit API remains available, we are committed to maintaining this library and bringing it up to the latest standards. We will continue to support this library as long as the API is accessible and will provide migration guidance when Health Connect integration becomes necessary.
# Expo
npx expo install react-native-google-fit
# React Native CLI
npm install react-native-google-fit --save
# or
yarn add react-native-google-fit
→ Full installation instructions
import GoogleFit, { Scopes } from 'react-native-google-fit'
// 1. Authorize
const options = {
scopes: [
Scopes.FITNESS_ACTIVITY_READ,
Scopes.FITNESS_ACTIVITY_WRITE,
Scopes.FITNESS_BODY_READ,
Scopes.FITNESS_BODY_WRITE,
],
}
const authResult = await GoogleFit.authorize(options)
// 2. Get daily steps
const steps = await GoogleFit.getDailyStepCountSamples({
startDate: "2024-01-01T00:00:00.000Z",
endDate: new Date().toISOString()
})
// 3. Save weight
await GoogleFit.saveWeight({
value: 75.5,
date: new Date().toISOString(),
unit: "kg"
})
Check out the example app repository for a complete working example.
Track steps, distance, move minutes, and calories burned.
Record and retrieve weight and height data.
Monitor cardiovascular health metrics.
Track blood glucose, body temperature, and oxygen saturation.
Log food intake and water consumption.
Record sleep sessions with stages (light, deep, REM).
Save and retrieve workout sessions with activity types.
Contributions are welcome! Please:
git checkout -b feature/amazing-feature)git commit -m 'feat: add amazing feature')git push origin feature/amazing-feature)See CONTRIBUTING.md for details.
"Authorization Failed"
"Google Play Services not available"
MIT © StasDoskalenko
Thanks to all contributors who have helped make this library better!
FAQs
A React Native bridge module for interacting with Google Fit
The npm package react-native-google-fit receives a total of 2,087 weekly downloads. As such, react-native-google-fit popularity was classified as popular.
We found that react-native-google-fit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.

Security News
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.