### Answer
When incorporating the Vapi Voice Widget into your WordPress site, it's normal for the API key and the assistant ID to appear within the JavaScript snippet, as they are required for the widget to function correctly [(1)](
) . However, exposing these in publicly accessible code can pose security risks.
Here are some measures to help mitigate potential security risks:
1. **Restrict API Key Permissions**: Ensure that the API key used in your website's frontend has limited permissions, only allowing operations that are absolutely necessary for the widget to function.
2. **Use Environment Variables**: If possible, set up your WordPress site in such a way that sensitive credentials like API keys can be stored in environment variables. This might require custom development or plugins that allow you to securely insert these variables into your JavaScript.
3. **Regularly Rotate API Keys**: Periodically change your API keys to minimize the risks associated with key exposure. This can be managed through the Vapi dashboard.
4. **Monitor and Audit**: Regularly monitor the usage of your API keys and review access logs to detect any unauthorized access or anomalies.
For integrating the Widget, you can follow the steps outlined in the installation guide from Vapi's documentation, which includes inserting the widget snippet correctly into your site's HTML.
If you're concerned about the visibility of these keys, consider implementing server-side management of key functionalities where feasible, which might not be directly covered by the current Vapi setup but could be achieved with additional backend development.
For more detailed guidance, reviewing security best practices and consulting with a security professional might be beneficial.
: [Voice Widget Example 🎧](
https://docs.vapi.ai/examples/voice