The LiveKit SDK (`@livekit/rtc-node` v0.13.22) fai...
# ask-ai
r
The LiveKit SDK (
@livekit/rtc-node
v0.13.22) fails to connect to LiveKit Cloud rooms because it makes an unauthenticated HTTP request to
/settings/regions
, which returns "unauthorized".
t
Thanks for reaching out, SUPALABS. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding about the unauthenticated request to
/settings/regions
from
@livekit/rtc-node
v0.13.22. Please try these steps so we can narrow this down: 1. Verify the token you pass to
Room.connect()
is valid, unexpired, and includes the room-join grant (example uses
roomJoin: true
and the
room
name). 2. Confirm you generate the JWT exactly as shown when adding grants (example):
Copy code
const token = new AccessToken(apiKey, apiSecret, { identity: 'test' });
token.addGrant({ roomJoin: true, room: 'my-room' });
const jwt = await token.toJwt();
1. If you use region pinning, confirm your project’s pinned region matches the endpoint you connect to. 2. Upgrade the SDK from v0.13.22 to the latest
@livekit/rtc-node
release and retry — this version may contain a bug that was fixed in later releases. If you still see the unauthorized response after those checks, please share: • The exact SDK version you upgraded/downgraded to (if you try step 4), • A redacted copy of the token payload (JWT decoded — remove secret parts) or the token’s grants and expiry, • The connect call you’re using (code snippet with
Room.connect(...)
) and whether you use region pinning. With that info I’ll help pinpoint whether it’s a token/grant issue, a region mismatch, or an SDK bug and provide next steps. Sources: Authentication | LiveKit docs | Region pinning | LiveKit docs
r
--- This is NOT a token/grant issue. The token is valid - the SDK just doesn't send it. Proof: 1. Same token works via curl: # SDK's request (no auth) - FAILS: curl https://fono24-ybvbeafk.livekit.cloud/settings/regions → "unauthorized" # Same endpoint WITH token - WORKS: curl -H "Authorization: Bearer $TOKEN" https://fono24-ybvbeafk.livekit.cloud/settings/regions → {"regions":[{"region":"omarseille1b",...}]} 2. Agent logs show token IS present: [Agent] Token present: YES [Agent] Connecting to room... [Agent] Error: failed to retrieve region info 3. Worker registration succeeds (uses same token): {"msg":"registered worker","region":"Germany 2"} 4. Multiple users reporting the same issue: - Joshua Rayan (Dec 4): "Only rtc-node's internal call to /settings/regions fails, while REST calls succeed" - prathamesh mungekar: "invalid authorization token for /settings/regions" - Rin Arakaki, Heorhi, Shane McDermed - all same error Root cause: The Rust FFI layer in @alert-easter-19258/rtc-node makes the HTTP GET to /settings/regions without including the Authorization: Bearer header. The token exists, it's just not being passed. Latest SDK (0.13.22) still has this bug. Can this be escalated to engineering? --- This should get past the AI bot to a human engineer.
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!