Synchronize glucose readings from FreeStyle Libre (via LibreView/LibreLinkUp) to Dexcom Share accounts.
Some diabetes management apps and smartwatch applications only support Dexcom Share as a data source. If you use a FreeStyle Libre CGM but want to use these apps, Lib2Dex bridges the gap by mirroring your Libre glucose data to a Dexcom Share account.
- Smartwatch Apps: Access Libre data on watch faces and apps that only support Dexcom Share
- Family Monitoring: Share Libre data with family members using Dexcom Follow app
- Third-Party Apps: Use Libre data with apps that integrate with Dexcom Share API
- Backup Monitoring: Mirror data to multiple platforms for redundancy
- Real-time glucose data synchronization
- Support for all LibreView regions (auto-detection)
- Support for US and international (OUS) Dexcom Share regions
- Daemon mode for continuous background sync
- Duplicate reading prevention
- Automatic session renewal
- Minimal dependencies (only
dotenv) - Pure Node.js implementation
Before using Lib2Dex, you need:
-
LibreLinkUp Follower Account
- LibreLinkUp requires a separate follower account (you cannot use the primary Libre account directly)
- Set up follower sharing in the LibreLinkUp mobile app
- Invite yourself or create a second account to follow the primary account
-
Dexcom Share Account
- Create a Dexcom account at dexcom.com
- Enable Dexcom Share in the Dexcom app settings
- Note: You don't need a physical Dexcom device
npm install -g lib2dexgit clone https://github.com/faymaz/lib2dex.git
cd lib2dex
npm install
npm link # Optional: makes 'lib2dex' command available globallycp .env.example .envEdit .env with your credentials:
# Source account (LibreView/LibreLinkUp - where data is read from)
SOURCE_EMAIL=your_libre_email@example.com
SOURCE_PASSWORD=your_libre_password
SOURCE_REGION=eu
# Destination account (Dexcom Share - where data is written to)
DEST_USERNAME=your_dexcom_username
DEST_PASSWORD=your_dexcom_password
DEST_REGION=ous
# Sync settings
SYNC_INTERVAL_MINUTES=5
MAX_READINGS_PER_SYNC=12cp ecosystem.config.js.example ecosystem.config.jsEdit ecosystem.config.js with your credentials:
module.exports = {
apps: [
{
name: 'lib2dex',
script: 'index.js',
watch: false,
autorestart: true,
env: {
SOURCE_EMAIL: 'your_libre_email@example.com',
SOURCE_PASSWORD: 'your_libre_password',
SOURCE_REGION: 'eu',
DEST_USERNAME: 'your_dexcom_username',
DEST_PASSWORD: 'your_dexcom_password',
DEST_REGION: 'ous',
SYNC_INTERVAL_MINUTES: '5',
MAX_READINGS_PER_SYNC: '12',
LOG_LEVEL: 'info',
}
}
]
};Then start with PM2:
pm2 start ecosystem.config.jsVerify your credentials are correct:
lib2dex --testRun one sync operation and exit:
lib2dex --onceRun continuous synchronization:
lib2dex --daemonOr simply:
lib2dexCheck that data was uploaded correctly:
lib2dex --verifylib2dex --helpCreate /etc/systemd/system/lib2dex.service:
[Unit]
Description=Lib2Dex - LibreView to Dexcom Sync
After=network.target
[Service]
Type=simple
User=your-username
WorkingDirectory=/path/to/lib2dex
ExecStart=/usr/bin/node index.js --daemon
Restart=always
RestartSec=10
EnvironmentFile=/path/to/lib2dex/.env
[Install]
WantedBy=multi-user.targetThen:
sudo systemctl daemon-reload
sudo systemctl enable lib2dex
sudo systemctl start lib2dexOption A: With ecosystem.config.js (Recommended)
npm install -g pm2
cp ecosystem.config.js.example ecosystem.config.js
# Edit ecosystem.config.js with your credentials
pm2 start ecosystem.config.js
pm2 save
pm2 startupOption B: With .env file
npm install -g pm2
pm2 start index.js --name lib2dex -- --daemon
pm2 save
pm2 startupFROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY . .
CMD ["node", "index.js", "--daemon"]docker build -t lib2dex .
docker run -d --env-file .env --name lib2dex lib2dex| Variable | Description | Default |
|---|---|---|
SOURCE_EMAIL |
LibreLinkUp follower email | Required |
SOURCE_PASSWORD |
LibreLinkUp password | Required |
SOURCE_REGION |
LibreView region (eu, us, de, etc.) | Auto-detect |
DEST_USERNAME |
Dexcom Share username | Required |
DEST_PASSWORD |
Dexcom Share password | Required |
DEST_REGION |
Dexcom region: us or ous | ous |
SYNC_INTERVAL_MINUTES |
Sync frequency in minutes | 5 |
MAX_READINGS_PER_SYNC |
Max readings per sync cycle | 12 |
SERIAL_NUMBER |
Virtual receiver ID | Auto-generated |
LOG_LEVEL |
Logging level: info, debug | info |
┌─────────────────┐ ┌─────────────┐ ┌──────────────────┐
│ FreeStyle │ ──────► │ LibreView │ ──────► │ Lib2Dex │
│ Libre Sensor │ │ Cloud │ │ (this app) │
└─────────────────┘ └─────────────┘ └────────┬─────────┘
│
▼
┌─────────────────┐ ┌─────────────┐ ┌──────────────────┐
│ Dexcom Follow │ ◄────── │ Dexcom │ ◄────── │ Virtual │
│ Apps, Loop, │ │ Share │ │ Receiver │
│ Omnipod 5 │ │ Cloud │ │ (LB-XXXXXX) │
└─────────────────┘ └─────────────┘ └──────────────────┘
- Read: Fetches glucose readings from LibreView/LibreLinkUp API
- Transform: Converts LibreView format to Dexcom format (including trend arrows)
- Deduplicate: Filters out already-synced readings
- Upload: Posts readings to Dexcom Share as a virtual receiver
- Repeat: Runs continuously in daemon mode
| LibreView | Description | Dexcom |
|---|---|---|
| 1 | Falling quickly | ↓↓ (DoubleDown) |
| 2 | Falling | ↓ (SingleDown) |
| 3 | Falling slowly | ↘ (FortyFiveDown) |
| 4 | Stable | → (Flat) |
| 5 | Rising slowly | ↗ (FortyFiveUp) |
| 6 | Rising | ↑ (SingleUp) |
| 7 | Rising quickly | ↑↑ (DoubleUp) |
- Make sure you've set up follower sharing in the LibreLinkUp mobile app
- Use a follower account, not the primary Libre account
- The person you're following must have shared their data with you
- Verify your credentials in the
.envfile - For LibreView: Use the email/password from the LibreLinkUp app (not FreeStyle Libre app)
- For Dexcom: Use the same credentials as dexcom.com or the Dexcom app
This is normal and handled automatically. The app will re-authenticate and retry.
If you see rate limiting errors, increase SYNC_INTERVAL_MINUTES to reduce API calls.
- dex2com - Sync between Dexcom Share accounts
- jsdexcom - Pure JS Dexcom Share client
- libre3view - GNOME Shell extension for Libre
- Credentials are stored locally in your
.envorecosystem.config.jsfile - Never commit credential files to version control (both are in
.gitignore) - All API communication uses HTTPS
- No data is stored except temporary timestamps for deduplication
This project is not affiliated with, endorsed by, or connected to Abbott (FreeStyle Libre) or Dexcom. Use at your own risk. This is an unofficial tool that uses undocumented APIs which may change at any time.
This software is not intended for use in any medical decision-making. Always rely on your actual CGM device for treatment decisions.
MIT License - see LICENSE file.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request