createSecret( )

Creates a new secret.

The createSecret() function returns a Promise that resolves to the newly created secret's ID when a secret has been created in the Secrets Manager. Secrets created by this function are available in the Secrets Manager section in your site's dashboard, just like any other secret created using the UI.


  • The secret's name cannot start with wix or be identical to an existing secret's name.

  • Do not leave private keys in your code! Leaving them in is a security risk. Either delete the keys from the code after running createSecret(), or pass the parameters in using the Functional Testing tool.

Method Declaration
Method Parameters

The object including the fields of a new secret to be stored.

Return Type:Promise<string>
Was this helpful?