This message was deleted.
# cloud
s
This message was deleted.
e
here’s the struct that i’ve got before encoding and signing
Copy code
%Cast.Adapters.Livekit.AccessToken{
  api_key: "API92NWXwrgWWCM",
  api_secret: "REDACTED",
  identity: "b6a84299-01fe-4e08-90cf-1b7188f0bb41",
  grants: %Cast.Adapters.Livekit.ClaimGrant{
    identity: "b6a84299-01fe-4e08-90cf-1b7188f0bb41",
    name: "55",
    metadata: nil,
    sha256: nil,
    video: %Cast.Adapters.Livekit.VideoGrant{
      roomCreate: nil,
      roomJoin: true,
      roomList: nil,
      roomRecord: nil,
      roomAdmin: nil,
      room: "592a4a21-c892-4880-8859-123884854e35",
      canPublish: nil,
      canPublishSources: nil,
      canSubscribe: nil,
      canPublishData: nil,
      canUpdateOwnMetadata: nil,
      hidden: nil,
      recorder: nil,
      ingressAdmin: nil
    }
  },
  name: "55",
  metadata: nil,
  ttl: 14400,
  sha256: nil
}
f
I'm using the following code (python) for token generation, and it never failed me. Maybe it could be adapted to ruby (I'm using Github Copilot to translate from one language to another). https://github.com/dguerizec/livekit-server-sdk-python/blob/main/livekit_server_sdk/__init__.py
e
do you mind sharing what a payload looks like with your code?
f
Hello @eager-guitar-63477, sorry for the late answer, I've been putting up a repo where I will collect useful bits of code to connect to livekit, It should be easier to use: https://github.com/dguerizec/livekit_tools I still need to write the README, but you can create a token with the following sample code:
Copy code
from livekit_tools import create_access_token
token = create_access_token(room_name="test-room", api_key="devkey", api_secret="secret", identity="test-client", ttl="1h")