how to get the api-key value
# ask-ai
r
how to get the api-key value
t
Thanks for reaching out, Hrithik. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Let's walk through how you can retrieve your API key value in LiveKit together: 1. Generate the API Key: First, head over to the LiveKit Cloud project settings page and create a new project. There, you'll find your API key (LIVEKIT_API_KEY) and secret (LIVEKIT_API_SECRET) ready for you. 2. Store the API Key: It's a good idea to keep your API key and secret safe by storing them in your environment variables, usually in a
.env
file. For example:
Copy code
LIVEKIT_API_KEY=your_api_key_here
LIVEKIT_API_SECRET=your_api_secret_here
LIVEKIT_URL=<wss://your-project.livekit.cloud>
3. Access the API Key in Code: When you're coding, you can access these values through environment variable methods. For instance, in Node.js:
Copy code
const apiKey = process.env.LIVEKIT_API_KEY;
const apiSecret = process.env.LIVEKIT_API_SECRET;
Just a friendly reminder: please make sure your API secret stays private and is never exposed on the client side or in public repositories. Using a backend server to issue access tokens is the safest way to go. Sources: agent-console/components/credential-settings.tsx | Mini tutorial: setting up a LiveKit Cloud project | packages/rpc-demo/.env.local | examples/.env.example | client/web/.env.example