Overview
This guide walks you through the complete flow of integrating Open Wearables with your application, from creating a user to fetching their health data.Step 1: Create a User
First, create a user in Open Wearables to represent your application’s user.id - you’ll need it for all subsequent API calls.
Step 2: Connect to a Provider
Initiate OAuth to connect the user to their wearable provider.authorization_url. After they authorize, they’ll be redirected back to your redirect_uri.
redirect_uri must be allowed by the instance: its origin must be FRONTEND_URL or one of CORS_ORIGINS, or it must be listed in OAUTH_REDIRECT_ALLOWLIST (comma-separated; web URLs match by origin, app schemes such as myapp://oauth/callback match exactly). Any other value gets a 400. The user comes back with provider, status (success or error) and, on error, message in the query, replacing any parameters of the same name. Errors land there too, so check status rather than assuming the connection succeeded.authorize needs a credential: your API key, or a token scoped to that one user. Calls without one get 401.
Frontend Example
Keep the API key on your backend. Have it mint a connect token for the user, and let the browser use that instead:authorize and only for the user it was minted for (another user_id gets 403). It expires after CONNECT_TOKEN_EXPIRE_DAYS (default 7).
Shareable Link
To let someone connect without building any UI, send thempair_url from the same response. It opens the Open Wearables pairing page, where they pick a provider and sign in. Links without a token are refused, so mint a new one when it expires. The dashboard’s Copy pairing link button does the same.
Step 3: Sync Data
After OAuth completes, an initial sync is triggered automatically. For subsequent syncs or to fetch historical data:For Garmin, including
summary_start_time and summary_end_time is recommended to specify the date range for data retrieval.Step 4: Fetch Data
Now you can fetch the user’s health data.Timeseries Data (Heart Rate, Steps, etc.)
Workouts
Sleep Sessions
Menstrual Cycles
Complete JavaScript Example
Next Steps
Provider Setup
Provider-specific configuration and requirements
Data Types
Available metrics, workout types, and data formats