You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -196,16 +194,43 @@ the `CONNECT_LINK_UP_PATIENT_ID` variable.
196
194
197
195
### Minimed Carelink
198
196
199
-
To synchronize from Medtronic Minimed Carelink, set the following
200
-
environment variables.
197
+
Medtronic CareLink now uses an OAuth2 PKCE flow — username and password authentication is no longer supported. Authentication requires a one-time login step to obtain OAuth tokens, which are then stored in MongoDB and refreshed automatically.
198
+
199
+
#### Setup
200
+
201
+
**Required environment variables:**
201
202
* `CONNECT_SOURCE=minimedcarelink`
202
-
* `CONNECT_CARELINK_USERNAME`
203
-
* `CONNECT_CARELINK_PASSWORD`
204
-
* `CONNECT_CARELINK_REGION` Either `eu` to set `CONNECT_CARELINK_SERVER` to
205
-
`carelink.minimed.eu` or `us` to use `carelink.minimed.com`.
203
+
* `MONGO_CONNECTION` — your MongoDB URI (same as Nightscout's `MONGO_CONNECTION`, no duplication needed)
204
+
* `CONNECT_CARELINK_REGION` — `eu` (default) or `us`
205
+
206
+
`CONNECT_CARELINK_USERNAME` and `CONNECT_CARELINK_PASSWORD` are no longer used and can be removed from your config.
207
+
208
+
#### One-time login
209
+
210
+
Before starting the poller for the first time, run:
211
+
212
+
```bash
213
+
nightscout-connect login # EU by default
214
+
nightscout-connect login --region us
215
+
```
216
+
217
+
This will open the CareLink login page in your browser. After logging in:
218
+
219
+
1. The page will **fail to load** — this is expected. CareLink redirects to a custom app scheme (`com.medtronic.carepartner://`) that the browser cannot handle
220
+
2. Open DevTools (`F12`) → Network tab → find the blocked request to `/authorize/resume`
221
+
3. Click it → Response Headers → copy the `Location` value (starts with `com.medtronic.carepartner:/sso?code=...`)
222
+
4. Paste it back into the terminal when prompted
223
+
224
+
Tokens are saved to MongoDB and the poller can now start. Token refresh is handled automatically — you only need to re-run `login` if the refresh token expires (~30 days).
225
+
226
+
#### Nightscout admin UI (optional)
227
+
228
+
If you are running [cgm-remote-monitor](https://github.com/nightscout/cgm-remote-monitor), the login flow is also available directly from the Nightscout `/admin` page under **CareLink Authentication** — no CLI access needed.
229
+
230
+
#### Many to Many
206
231
207
-
For folks using the new Many to Many feature, please provide the username of the
208
-
patient to follow using `CONNECT_CARELINK_PATIENT_USERNAME` variable.
232
+
For folks using the Many to Many feature, provide the username of the patient to follow:
0 commit comments