createSecret( )


Creates a new secret.

The createSecret() function returns a Promise that resolves secret ID when the secret is created.

Notes:

  • The secret's name cannot start with 'wix' or be identical to an existing secret's name.
  • Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running createSecret().
Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Secrets
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
secretSecretRequired

Fields of a new secret.

Returns
Return Type:Promise<string>
Was this helpful?
Yes
No