We’re building a remote-assistance app using LiveKit Cloud: a hardware device publishes via RTMP, and a mobile app subscribes via WebRTC. Devices can be unpaired and transferred to another account. We’re considering one reusable ingress per pairing lifecycle, rather than per viewing session, using livekit-server-sdk@2.19.1.
Could a human engineer clarify:
If UpdateIngress changes the room while preserving the publishing key, can a publisher holding the old key publish into the new room? What lifecycle do you recommend to ensure isolation when device ownership changes?
During initial provisioning, if CreateIngress times out before we receive its ID and ListIngress returns no match, what supported recovery procedure should we follow? When, if ever, is it safe to retry creation?
We’d prefer the simplest supported workflow. Links to relevant documentation would be appreciated.
This is a bit outside my area of expertise. But don’t rely on UpdateIngress to revoke an old publisher key. I assume you already tried the “Ask AI” button at the bottom of this post for docs?
Isolation when ownership changes
Yes. UpdateIngress changes the room but leaves the stream key as it is, so a device holding the old key can publish into the new room. If the device is live when you update, its stream moves to the new room. The stream key is tied to the ingress, and there’s no way to rotate it on an existing ingress.
For isolation, treat the ingress as owned by one pairing:
On pairing: CreateIngress with a room that belongs to that owner, and give the key to the device.
On unpair or transfer: DeleteIngress. This revokes the key and stops any active stream right away. Then CreateIngress for the new owner, so the new owner gets a fresh key.
Use UpdateIngress only for changes within the same owner, never to hand a device to someone else.
A CreateIngress call that times out
Set a unique, deterministic name on every create, for example your pairing ID. Then:
When a create times out, call ListIngress (no filter, or filtered by the room you requested) and look for that name.
If you find it, use that ingress. Its streamKey and url are in the result.
If you don’t, wait a few seconds and list again; the original request may still be in flight. If it’s still missing, it’s safe to call CreateIngress again.
Afterwards, if more than one ingress has the same name, keep one and delete the others. A stray ingress whose key you never received can’t be published to, but it counts toward your project’s ingress limit, so clean it up.