Root cause identified: rtc-node FFI layer bug
I analyzed the LiveKit codebase and found the issue. All core RegionUrlProvider implementations correctly include
Authorization: Bearer:
| SDK | Auth Header | Code |
|--------------|-------------|------------------------------------------------------------|
| Rust | ✅ | headers.insert(AUTHORIZATION, format!("Bearer {}", token)) |
| JavaScript | ✅ | headers: { authorization: 'Bearer token' } |
| Android | ✅ | .header("Authorization", "Bearer $token") |
| Flutter | ✅ | 'authorization': 'Bearer $token' |
| rtc-node FFI | ❌ | Not passing token to Rust |
The bug is in uniffi-bindgen-node - the FFI layer that bridges Node.js to Rust. The token exists (logs show "Token
present: YES"), but the FFI binding isn't forwarding it to RegionUrlProvider::fetch_region_urls.
Proof:
# Without auth (what SDK does) - FAILS
curl https://<project>.livekit.cloud/settings/regions
→ "unauthorized"
# With auth (correct behavior) - WORKS
curl -H "Authorization: Bearer $TOKEN" https://<project>.livekit.cloud/settings/regions
→ {"regions":[...]}
Affected: @livekit/rtc-node 0.13.x, @livekit/agents 1.0.x
Users impacted: 8+ in this Slack (Joshua Rayan, prathamesh, Rin Arakaki, Heorhi, Shane McDermed, Gaurav Jarwal,
Maarten, myself)
Can engineering check the token handling in livekit/uniffi-bindgen-node/templates/node.ts?
@lively-winter-88668