Synchronize glucose data from FreeStyle Libre (LibreView/LibreLinkUp) to Dexcom Share accounts
npm install lib2dex

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:
1. 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
2. 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
``bash`
npm install -g lib2dex
`bash`
git clone https://github.com/faymaz/lib2dex.git
cd lib2dex
npm install
npm link # Optional: makes 'lib2dex' command available globally
`bash`
cp .env.example .env
Edit .env with your credentials:
`envSource account (LibreView/LibreLinkUp - where data is read from)
SOURCE_EMAIL=your_libre_email@example.com
SOURCE_PASSWORD=your_libre_password
SOURCE_REGION=eu
$3
`bash
cp ecosystem.config.js.example ecosystem.config.js
`Edit
ecosystem.config.js with your credentials:`javascript
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:
`bash
pm2 start ecosystem.config.js
`Usage
$3
Verify your credentials are correct:
`bash
lib2dex --test
`$3
Run one sync operation and exit:
`bash
lib2dex --once
`$3
Run continuous synchronization:
`bash
lib2dex --daemon
`Or simply:
`bash
lib2dex
`$3
Check that data was uploaded correctly:
`bash
lib2dex --verify
`$3
`bash
lib2dex --help
`Running as a Service
$3
Create
/etc/systemd/system/lib2dex.service:`ini
[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.target
`Then:
`bash
sudo systemctl daemon-reload
sudo systemctl enable lib2dex
sudo systemctl start lib2dex
`$3
Option A: With ecosystem.config.js (Recommended)
`bash
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 startup
`Option B: With .env file
`bash
npm install -g pm2
pm2 start index.js --name lib2dex -- --daemon
pm2 save
pm2 startup
`$3
`dockerfile
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY . .
CMD ["node", "index.js", "--daemon"]
``bash
docker build -t lib2dex .
docker run -d --env-file .env --name lib2dex lib2dex
`Configuration Options
| 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 |How It Works
`
┌─────────────────┐ ┌─────────────┐ ┌──────────────────┐
│ FreeStyle │ ──────► │ LibreView │ ──────► │ Lib2Dex │
│ Libre Sensor │ │ Cloud │ │ (this app) │
└─────────────────┘ └─────────────┘ └────────┬─────────┘
│
▼
┌─────────────────┐ ┌─────────────┐ ┌──────────────────┐
│ Dexcom Follow │ ◄────── │ Dexcom │ ◄────── │ Virtual │
│ Apps, Loop, │ │ Share │ │ Receiver │
│ Omnipod 5 │ │ Cloud │ │ (LB-XXXXXX) │
└─────────────────┘ └─────────────┘ └──────────────────┘
`1. Read: Fetches glucose readings from LibreView/LibreLinkUp API
2. Transform: Converts LibreView format to Dexcom format (including trend arrows)
3. Deduplicate: Filters out already-synced readings
4. Upload: Posts readings to Dexcom Share as a virtual receiver
5. Repeat: Runs continuously in daemon mode
Trend Arrow Mapping
| 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) |
Troubleshooting
$3
- 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
$3
- Verify your credentials in the
.env file
- 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$3
This is normal and handled automatically. The app will re-authenticate and retry.
$3
If you see rate limiting errors, increase
SYNC_INTERVAL_MINUTES to reduce API calls.Related Projects
- dex2com - Sync between Dexcom Share accounts
- jsdexcom - Pure JS Dexcom Share client
- libre3view - GNOME Shell extension for Libre
Security Notes
- Credentials are stored locally in your
.env or ecosystem.config.js file
- Never commit credential files to version control (both are in .gitignore)
- All API communication uses HTTPS
- No data is stored except temporary timestamps for deduplicationDisclaimer
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.
License
MIT License - see LICENSE file.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (
git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add amazing feature')
4. Push to the branch (git push origin feature/amazing-feature`)