How do you connect to the lk playground?
# ask-ai
r
How do you connect to the lk playground?
t
Thanks for reaching out, Rithvik. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're asking how to connect to the LiveKit Agents Playground — here’s a quick way to get started. 1. Run your agent in dev mode: ◦ Python:
Copy code
uv run agent.py dev
• Node.js: Add a dev script to `package.json`:
Copy code
pnpm pkg set "scripts.dev=tsx agent.ts dev"
Then run:
Copy code
pnpm dev
1. Open the hosted playground in your browser: ◦ https://agents-playground.livekit.io/ 1. Interact with your agent: ◦ The playground will connect to the agent you started in dev mode; you can send text, use microphone/camera, or test multimodal inputs. Would you like help verifying your agent is reachable from the playground or troubleshooting a connection that’s failing? Sources: Agents playground | LiveKit Docs | An open source stack for real-time multimodal AI
r
How do you get the room token?
t
You get a room token by generating it on your backend (tokens require your API secret). Quick steps: 1. Generate server-side with a Server SDK (Node/Go/Python/Ruby). Example (Node):
Copy code
import { AccessToken } from 'livekit-server-sdk';

const at = new AccessToken('YOUR_API_KEY', 'YOUR_API_SECRET', {
  identity: 'user123',
  ttl: '1h',
});

at.addGrant({
  roomJoin: true,
  room: 'my-room-name',
  canPublish: true,
  canSubscribe: true,
});

const token = await at.toJwt();
1. Return that token from your backend endpoint to the client. 2. Client uses it to connect:
Copy code
const room = new Room();
await room.connect('<wss://your-livekit-url>', token);
For quick testing you can create a token with the CLI:
Copy code
lk token create --api-key <key> --api-secret <secret> --join --room my-room-name --identity test-user --valid-for 24h
Never expose your API secret in client code. Do you want the Node, Python, or CLI example expanded, or help wiring a backend endpoint? Sources: Authentication | LiveKit docs | Generating tokens | LiveKit docs | LiveKit CLI Setup | LiveKit Docs