Repository navigation
feat: let wrapper SDKs report their own identity in ClientInfo - #2265
Conversation
Adds an internal setWrapperSdkInfo() so SDKs built on top of livekit-client (e.g. Unity WebGL) report their own SDK and version to the server instead of JS. livekit-client's version moves to ClientInfo.other_sdks. The v0 `sdk` query param is now derived from ClientInfo.sdk, keeping the v0 and v1 signal paths consistent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 9a3f051 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
The core build strips @internal members, which left the shared export of setWrapperSdkInfo dangling in dist/core/types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| // ClientInfo | ||
| params.set('sdk', isReactNative() ? 'reactnative' : 'js'); | ||
| // the server expects the enum name lowercased without underscores, e.g. 'js', 'reactnative', 'unityweb' | ||
| params.set('sdk', ClientInfo_SDK[info.sdk!].toLowerCase().replace(/_/g, '')); |
There was a problem hiding this comment.
.replace(/_/g, '') removes every underscore, giving unityweb and reactnative
| } | ||
|
|
||
| export function getClientInfo(capabilities?: ClientInfo_Capability[]): ClientInfo { | ||
| let sdk = isReactNative() ? ClientInfo_SDK.REACT_NATIVE : ClientInfo_SDK.JS; |
There was a problem hiding this comment.
The old react native path is still used here, so this does not force an update in the React SDK.
There was a problem hiding this comment.
thought: I think this makes sense, but I do wonder if it would be preferable longer term if react native were to also use setWrapperSdkInfo? Or if there were a way to introduce a isUnityWeb function? I think ideally it would be good if this worked the same across platforms.
Also, I'm guessing this isn't a thing today, but in the future if we needed to gate some functionality to only happen on unity web then a isUnityWeb would be important to have as well.
There was a problem hiding this comment.
Same comment as in Slack:
"The current react native way is a bit more hacky in my opinion, so the next step in unifying would be to move react native over to use the function instead of setting the property."
1egoman
left a comment
There was a problem hiding this comment.
I think this makes sense, but see my comment for one possible idea to make this more consistent with react native.
What and why
Adds an internal setWrapperSdkInfo() so SDKs built on top of livekit-client (e.g. Unity WebGL) report their own SDK and version to the server instead of JS. livekit-client's version moves to ClientInfo.other_sdks.
The v0
sdkquery param is now derived from ClientInfo.sdk, keeping the v0 and v1 signal paths consistent.REACT_NATIVEstill works if set through the old path ofisReactNativeUsage
Used by livekit/client-sdk-unity-web#84
Checklist