Merged
Conversation
92ba1e9 to
9f0332b
Compare
1egoman
reviewed
Apr 8, 2026
1egoman
reviewed
Apr 9, 2026
1egoman
left a comment
There was a problem hiding this comment.
These are definitely fairly uninformed comments given my lack of unity expertise, but hopefully at least somewhat helpful!
1egoman
approved these changes
Apr 10, 2026
1egoman
left a comment
There was a problem hiding this comment.
Makes sense to me at a high level! If you want a deeper review of your c# code it might be worth waiting for a review from the other reviewers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background:
Token usage was a pain for first time developers of LiveKit. Especially Unity devs are not always good at web technologies. I implemented a version of the TokenSource concept we have in other SDKs as well to lower the entry barrier for new devs.
Changes:
Reuses TokenService.cs and utils from our Agent Example (thanks @ladvoc) and adopt it into TokenSource.cs.
You can create new config assets, one empty one is in the Meet project already.
How to test:
Read the README.md paragraph about tokens and see if this makes sense.
Use the LiveKit Meet sample scene. Put an auth config instance into the TokenService:

This is how the UI of the assets look like:



New README Paragraph:
Tokens
You need a token to join a LiveKit room as a participant. Read more about tokens here: https://docs.livekit.io/frontends/reference/tokens-grants/
To help getting started with tokens, use
TokenSource.cswith aTokenSourceConfigScriptableObject (see https://docs.livekit.io/frontends/build/authentication/#tokensource). Create a config asset via Right Click > Create > LiveKit > Token Source Config and select one of three token source types:1. Literal
Use this to pass a pregenerated server URL and token. Generate tokens via the LiveKit CLI or from your LiveKit Cloud project's API key page.
2. Sandbox
For development and testing. Follow the sandbox token server guide to enable your project's sandbox and get the sandbox ID. Optional connection fields (room name, participant name, agent name, etc.) can be configured in the inspector — leave blank for server defaults.
3. Endpoint
For production. Point to your own token endpoint URL and add any required authentication headers. Uses the same connection options as Sandbox. See the endpoint token generation guide.
Usage
Add a
TokenSourcecomponent to a GameObject, assign yourTokenSourceConfigasset, then fetch connection details before connecting: