n8n-nodes-withings
v1.2.0
Published
n8n node for Withings API integration with integrated OAuth2
Maintainers
Readme
n8n-nodes-withings
This is an n8n community node for integrating with the Withings API. It provides nodes to access health and fitness data from your Withings account.
Features
- Complete integration with Withings API resources:
- Activity data (getactivity, getsummary, getworkouts)
- Measurements (getmeas, getactivity, getintradayactivity)
- Sleep data (get, getsummary)
- User information (getdevice, getgoals, get)
- Customizable parameters for all API operations
- Proper error handling and response formatting
- Automatic token refresh
Prerequisites
- n8n (version 1.0.0 or later)
- Withings developer account and API credentials
- n8n-nodes-withings-oauth2-credential package (required for OAuth2 authentication)
Installation
IMPORTANT: This package requires the separate credential package to handle Withings' non-standard OAuth2 implementation.
Install both packages:
# 1. Install the OAuth2 credential package first
npm install n8n-nodes-withings-oauth2-credential
# 2. Then install this node package
npm install n8n-nodes-withingsFor Docker-based n8n installations:
# Add both packages to your docker-compose.yml or Dockerfile
npm install n8n-nodes-withings-oauth2-credential n8n-nodes-withingsOr use the n8n-docker-custom approach.
Configuration
- Create a developer account at Withings Developer
- Register a new application to get your Client ID and Client Secret
- Set the callback URL to:
https://your-n8n-domain.com/rest/oauth2-credential/callback - In n8n, create a new credential of type "Withings OAuth2 API" (provided by the credential package)
- Enter your Client ID and Client Secret
- Configure the scopes as needed (default: user.info,user.metrics,user.activity,user.sleepevents)
- Click "Connect my account" and complete the OAuth2 flow
Why Two Packages?
Withings uses a non-standard OAuth2 implementation that requires an additional action=requesttoken parameter in the token request body. N8n's standard OAuth2 doesn't support modifying the token request body, so we need a separate credential package that uses genericOAuth2Api with a custom authenticate() method to inject this parameter.
Usage
Once installed and configured, you can use the Withings API node in your workflows:
- Add a "Withings API" node to your workflow
- Select your Withings OAuth2 credential
- Choose the resource (Activity, Measure, Sleep, or User)
- Choose the operation (e.g., "Get" for sleep data)
- Configure any additional parameters (date ranges, data fields, etc.)
Example Workflows
Get Sleep Data
Manual Trigger → Withings API (Sleep / Get) → Process DataConfigure the node:
- Resource: Sleep
- Operation: Get
- Additional Fields:
- Start Date: 2025-01-01
- End Date: 2025-01-31
- Data Fields: hr, rr, snoring
Get Daily Activity Summary
Schedule Trigger → Withings API (Activity / Get Summary) → Store in DatabaseAPI Resources
Activity
- Get Activity: Retrieve user activity data
- Get Summary: Get activity summary
- Get Workouts: Fetch workout data
Measure
- Get Measurements: Get measurement data (weight, height, blood pressure, etc.)
- Get Activity: Get user intraday activity
- Get Intradayactivity: Get detailed intraday activity
Sleep
- Get: Get sleep data (with optional HR, RR, snoring data)
- Get Summary: Get sleep summary
User
- Get Device: Get user devices
- Get Goals: Get user goals
- Get: Get user information
Troubleshooting
"Unable to sign without access token" Error
This usually means the OAuth2 flow didn't complete successfully. Try:
- Make sure you installed both packages (credential + node)
- Delete and recreate your Withings OAuth2 credential
- Click "Connect my account" again
- Check the n8n logs for detailed error messages
Token Expired
Tokens automatically refresh. If you see token errors:
- Reconnect your account in the credentials settings
- Check that your Withings app credentials are still valid
Development
# Clone the repository
git clone https://github.com/schimmmi/n8n-nodes-withings.git
# Install dependencies
npm install
# Build
npm run build
# Watch mode for development
npm run devVersion History
See CHANGELOG.md for detailed version history.
Latest: v1.0.0
- BREAKING CHANGE: Removed built-in OAuth2 credentials
- Now requires separate
n8n-nodes-withings-oauth2-credentialpackage - Cleaner separation of concerns between node logic and OAuth2 authentication
- Simplified maintenance and updates
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
Links
Support
For issues, questions, or feature requests, please open an issue on GitHub.
