Secret storage

Learn how to use secret storage in Voximplant.
View as Markdown

Voximplant provides a secret storage for keeping your sensitive data such as passwords, API keys, or tokens and using them in your application.

Managing secrets

To create a secret:

  1. Open your control panel and select a necessary application
  2. Select Secrets in the left menu

Secrets menu

  1. Click the Add secret button and follow the instructions to create a secret

To edit or delete the secret, click the corresponding button in the secret record:

Secret buttons

Management API

You can create, edit, and delete secrets via Management API requests. Use the AddSecret, SetSecretInfo, and DelSecret methods to manage secrets.

Usage

To use a saved secret in your scenario, use the VoxEngine.getSecretValue() method.

Here’s a example on how to get a secret in a scenario:

Getting a secret in a scenario
1VoxEngine.addEventListener(AppEvents.Started, () => {
2 const secretKey = 'test';
3 const secret = VoxEngine.getSecretValue(secretKey);
4 const message = typeof secret === 'undefined' ? 'The secret value is undefined!' : secret;
5 Logger.write(`===> ${message}`);
6 VoxEngine.terminate();
7});

See also