Skip to content

token-server that dispatches LiveKit and FishNet servers for AnyVR usage.

Notifications You must be signed in to change notification settings

rwthlfi/AnyVR-TokenServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

livekit-token-ffi

A simple dynamic library providing an FFI for generating LiveKit tokens. Uses the official LiveKit Rust SDK.

This library was created to be used in the AnyVR Unity package.

Build

cargo build --release

Usage in Unity / AnyVR

The dedicated AnyVR Unity server runs on Linux, so compiling this crate into a Linux library is sufficient.

Import the generated 'liblivekit_tokengen_ffi.so' file into the 'Plugins/Linux' directory and declare an FFI method as follows.

[DllImport("livekit_tokengen_ffi", EntryPoint = "create_token")]
public static extern string CreateToken(string room, string userName, string userIdentity);

The library reads the two environmental variables 'LIVEKIT_API_KEY' and 'LIVEKIT_API_SECRET' which have to be set in the environment of the Unity server process.

The tokens should only be generated on the Unity server, so the library does not have to be linked in the client builds.

About

token-server that dispatches LiveKit and FishNet servers for AnyVR usage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages