DEV Community

Discussion on: Getting Started with ElevenLabs Text-to-Speech API

Collapse
 
greg_cf3a672509a4 profile image
Greg

Would this approach expose your api key?

Collapse
 
thecmdrunner profile image
Pranav

Yes, this will include the API key in your frontend code. You should instead create an API endpoint or use Server Actions (if you're using nextjs) for this.

Collapse
 
ssk14 profile image
Sanjay 🥷

Hello @greg, we should always use API key as environment variables in .env files.